I'd say it varies more than somewhat, but rather a lot, by field (and maybe by school).
233 karma · joined March 14, 2016
Agreed. An interesting exercise is to try the reverse: implementing a condition variable with a semaphore. It's not trivial to do correctly.
I teach OS, and I still cover semaphores, but I always tell the class that I don't think they are very useful. I spend much more time on condition variables.
Thus, the adding of the two edges must be atomic (when observed from the rest of the system).
(The example is a bit contrived, but hopefully gets the idea across.)