Can every imaginable synchronization problem be solved with judicious use of semaphores? What about weak semaphores?
+2
A:
No. Just for example, it's impossible for a system that uses only semaphores for synchronization to provide wait-free guarantees, or even progress guarantees, in the face of third-party code (e.g. a plugin). A perverse or poorly-written section of code can deny access to a semaphore-guarded section of code to everyone forever.
David Seiler
2009-12-23 14:08:43
I don't think this answers the right question. The problem is whether semaphores are sufficient to implement all other synchronisation primitives. I don't think any implementation could withstand injection of incorrect code at arbitrary points, whether it use locks or semaphores or what have you.
Paul Du Bois
2010-08-17 19:24:06