Are “benaphores” worth implementing on modern OS's?
问题 Back in my days as a BeOS programmer, I read this article by Benoit Schillings, describing how to create a "benaphore": a method of using atomic variable to enforce a critical section that avoids the need acquire/release a mutex in the common (no-contention) case. I thought that was rather clever, and it seems like you could do the same trick on any platform that supports atomic-increment/decrement. On the other hand, this looks like something that could just as easily be included in the