UNIX - General Discussions  Solve problems - It's Free  Create
your account in seconds Email address  Between 5 and 30
characters. No spaces please Notify me of new activity in this
group: Keep me informed of the latest:  Spinlock and Semaphore?
What are the differences between Spinlock and Semaphores? What
are the specific kinds of situations in which one would be
preferred over the other? 4 Replies Mark this reply as the best
answer? (Choose carefully, this can't be changed) Yes  |  No
Jalal Hajigholamali replied Jul 10  A semaphore is a "yielding"
synchronization object, a spinlock is a 'busywait' one. (there's
a little more to semaphores in that they synchronise several
threads, unlike a mutex or guard or monitor or critical section
that protects a code region from a single  You'd use a semaphore
in more circumstances, but use a spinlock where you are going to
lock for a very short time - there is a cost to locking
especially if you lock a lot. In such cases it can be more
efficient to spinlock for a lit