Alexander Terekhov wrote:
"Victor A. Wagner, Jr." wrote:

I'm baffled that they want to penalize (time and space) those for whom a
naked semaphore works.  It's blatantly clear to anyone who's had to write a
mutex that it's additional code on TOP of a semaphore.


Optimization stratergies aside (they are different for mutexes and semas) a binary semaphore can be used as "normal" POSIX mutex.

yes, binary semaphores may be implemented with a mutex (though I think
there is a subtle problem as POSIX mutex locks are owned, while semaphores are not).


But binary semaphore are only a (small) subclass of semaphores, and I'd
use semaphores mostly to represent value *and* lock, where the value's domain is larger than just 1/0.


Stefan

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to