Locking from primitives



Am a Beginner, so excuse if something is silly.

A friend was asked a question in an interview.
Given atomic increment & decrement operations
how would one implement locking functions?

I tried various ways, but can't arrive at a working
solution.

Is this problem solvable? Are there any extra
operations one would need?

If not, can some one give me a solution or hints
about the direction in which I can attack the problem.


.



Relevant Pages

  • Re: Locking from primitives
    ... A friend was asked a question in an interview. ... Given atomic increment & decrement operations ... You need an increment/decrement that returns a condition code based ...
    (comp.programming)
  • Re: Locking from primitives
    ... A friend was asked a question in an interview. ... Given atomic increment & decrement operations ...
    (comp.programming)
  • Re: Locking from primitives
    ... A friend was asked a question in an interview. ... Given atomic increment & decrement operations ... how would one implement locking functions? ...
    (comp.programming)
  • Re: Locking from primitives
    ... A friend was asked a question in an interview. ... Given atomic increment & decrement operations ... how would one implement locking functions? ...
    (comp.programming)