4 ms·
> However, the point Linus was making (in a humorous way) was that like most computer scientists / mathematicians, Dijkstra was overly fond of obscure, single-l
by learnstats2 12y ago
> However, the point Linus was making (in a humorous way) was that like most computer scientists / mathematicians, Dijkstra was overly fond of obscure, single-letter names, which nobody ever intuitively understands.
If he was making this point, I find it ironic, considering that the purpose of the post is to explain the distinction between two obscure, poorly-named technical words, which nobody ever intuitively understands.
- viraptor 12y agoHi, I'm nobody. You use spinlock to spin in place until you can get the lock. You wait at semaphores. Seems very intuitive to me.
- learnstats2 12y agosemaphore (ˈsɛməˌfɔː) n 1. (Telecommunications) an apparatus for conveying information by means of visual signals, as with movable arms or railway signals, flags, etc 2. (Telecommunications) a system of signalling by holding a flag in each hand and moving the arms to designated positions to denote each letter of the alphabet vb 3. (Telecommunications) to signal (information) by means of semaphore which definition fits your understanding that you 'wait'? It's not a good name.
- viraptor 12y agoThere are more meanings for semaphore: https://en.wikipedia.org/wiki/Railway_semaphore_signal https://en.wikipedia.org/wiki/Railway_semaphore_signal Edit: Ok, actually that could be within your first meaning. But the practical result for railway semaphores is that one of their uses is to stop trains from entering a blocked segment.
- couchand 12y agoIt's actually quite reasonable to complain about the use of the term semaphore here. As you recognize, stopping the train is only one of their uses. Railway signals can convey many different types of information about the state of the track, not just free/blocked. And moreover, a semaphore is just a specific type of railway signal, one with a pivoting arm. It's very hard to see how a pivoting arm is at all related to the CS concept.
- viraptor 12y agoNot sure if it's reasonable to complain really... I mean, it's not covering everything semaphores do, but the basics are there - gives information and stops two trains/threads colliding. References to trains when talking about cs semaphores are all over the place. Universities: http://ro.uow.edu.au/cgi/viewcontent.cgi?article=1027&context=compsciwp http://ro.uow.edu.au/cgi/viewcontent.cgi?article=1027&contex... http://courses.teresco.org/cs432_f02/lectures/07-synch/07-synch.html http://courses.teresco.org/cs432_f02/lectures/07-synch/07-sy... https://www.cs.cmu.edu/~410-f03/lectures/L09_Synch.txt https://www.cs.cmu.edu/~410-f03/lectures/L09_Synch.txt https://www.cs.ucsb.edu/~rich/class/cs170/notes/Semaphores/ https://www.cs.ucsb.edu/~rich/class/cs170/notes/Semaphores/ Documentations: https://doc.micrium.com/display/osiiidoc/Semaphores+in+uC-OS-III https://doc.micrium.com/display/osiiidoc/Semaphores+in+uC-OS... Articles: http://realtimepartner.com/articles/semaphores.html http://realtimepartner.com/articles/semaphores.html http://lycog.com/distributed-systems/semaphore-mutual-exclusion-in-single-system/ http://lycog.com/distributed-systems/semaphore-mutual-exclus... If we're going to compare it to any real life object, it may as well be a semaphore. Anything else will have the same issues. Traffic lights: what about yellow / blinking. Stop signs: why do they sometimes stop, sometimes not. etc. Is there any single word/phrase concept which you'd rather use instead? Is it much more convenient and clear than a semaphore?
- couchand 12y agoIs it much more convenient and clear than a semaphore? My point was simply that the only reason "semaphore" is clear is that you've already heard or read those lectures talking about it. There's nothing about the railroad meaning of the term that would imply the computer science meaning. A counter that can never go below zero is entirely unrelated to a pivoting arm. Once you know the connection it can serve as something of a reminder, but that's different from having an intuitive understanding in the first place. EDIT: Getting from RR semaphore to CS semaphore requires several leaps of intuition. On the railroad side you need to recognize that it is a signal that's important, and it's irrelevant whether that signal is implemented as a semaphore, an electric signal, or even a flagman. On the computer science side you need to know the difference between a semaphore and the many other types of mutual exclusion mechanisms. So in that sense "semaphore" is poorly named: it provides insufficient context to distinguish the concept from other similar, yet distinct, ideas.