Live data from Hacker News

Linus Torvalds on semaphores (1999)

yarchive.net

11–20 of 112 posts

Re: Linus Torvalds on semaphores (1999)

#12
post #10

Here's Dijkstra's original paper on P and V (in Dutch), from about 1963. http://www.cs.utexas.edu/users/EWD/transcriptions/EWD00xx/EW... Here is a implementation of P and V, the original counted semaphore primitives, from 1972. http://www.fourmilab.ch/documents/univac/fang/ This is UNIVAC 1108 assembly code. Along with P and V is the code for bounded buffers, with the operations "PUT" and "GET". Bounded buffers are w…

For those wondering, P comes from 'Passering', roughly translated 'pass' (as a noun), and V from 'Vrijgave' ('release'). Apparently somehow this terminology comes from train systems but there's not a lot of context on that etymology.

As an aside, this paper (it's actually the transcription of a lecture) has some great metaphors that explain problems with concurrence and issues with synchronisation. At the risk of losing much of the nuances, he essentially illustrates the synchronisation using the example of a teacher who needs to find a pupil in a class. When pupils are free to choose a seat, she needs to scan all seats when she is looking for a particular pupil; but when at the same time pupils are free to change seats as she's scanning, there is no guarantee that she will ever find the pupil she's looking for as he might run from the back of the class to the front as soon as she's done scanning the front.

Re: Linus Torvalds on semaphores (1999)

#14

Earlier quoted context omitted.

He did start out by saying Peter Samuelson's CS education was bad, so there was certainly some of the infamous Linus in there.

Can you blame Linus for saying that? I can't speak with precision about 1999, but someone assumed to have a CS education should know the difference between semaphore and spinlock.

[deleted]

Re: Linus Torvalds on semaphores (1999)

#15

For those that care why Dijskstra used P() and V(): P for Passering; V for Vrijgave (release)

Thanks. Fun quote FTA:

"" They originally had operations called "P()" and "V()", but nobody ever remembers whether P() was down() or up(), so nobody uses those names any more. Dijkstra was probably a bit heavy on drugs or something (I think the official explanation is that P and V are the first letters in some Dutch words, but I personally find the drug overdose story much more believable). ""

Re: Linus Torvalds on semaphores (1999)

#16

it's surprising that Linus answers peacefully and pedagogically ! and thus it's a nice read to refresh the definition of semaphores, spinlocks and mutexes. Maybe you can edit the title and add a little [199] :-)

He did start out by saying Peter Samuelson's CS education was bad, so there was certainly some of the infamous Linus in there.

Erm, firstly he didn't say Peter's Samuelson's CS education was bad. He said "your CS courses were bad" and then follows up with "...(or just didn't cover much about concurrency, which is fairly common) ..." . I think, you might have been trying very hard to find some of the Linus you imagined in there.

Re: Linus Torvalds on semaphores (1999)

#17
post #12
post #10

Here's Dijkstra's original paper on P and V (in Dutch), from about 1963. http://www.cs.utexas.edu/users/EWD/transcriptions/EWD00xx/EW... Here is a implementation of P and V, the original counted semaphore primitives, from 1972. http://www.fourmilab.ch/documents/univac/fang/ This is UNIVAC 1108 assembly code. Along with P and V is the code for bounded buffers, with the operations "PUT" and "GET". Bounded buffers are w…

For those wondering, P comes from 'Passering', roughly translated 'pass' (as a noun), and V from 'Vrijgave' ('release'). Apparently somehow this terminology comes from train systems but there's not a lot of context on that etymology. As an aside, this paper (it's actually the transcription of a lecture) has some great metaphors that explain problems with concurrence and issues with synchronisation. At the risk of los…

From what I've heard, the P comes from "Probeer" (to "try"), and the V from "verhoog" (increase).

This makes more sense to me.

Re: Linus Torvalds on semaphores (1999)

#18

"Dijkstra was probably a bit heavy on drugs or something (I think the official explanation is that P and V are the first letters in some Dutch words, but I personally find the drug overdose story much more believable)." Quotes like this are why I always read what Linus has to say, regardless of whether the subject is relevant to my life in the slightest. Edit: Yes people, those Dutch words exist! I get it! I'm sure L…

Me too. I just love this guy. Sure, some people find him insulting, but I call that "funny".

Re: Linus Torvalds on semaphores (1999)

#20

"Dijkstra was probably a bit heavy on drugs or something (I think the official explanation is that P and V are the first letters in some Dutch words, but I personally find the drug overdose story much more believable)." Quotes like this are why I always read what Linus has to say, regardless of whether the subject is relevant to my life in the slightest. Edit: Yes people, those Dutch words exist! I get it! I'm sure L…

To say that a mathematician doesn't intuitively understand single-letter names would be like saying a programmer doesn't intuitively understand a keyboard.

Dijkstra was a computer scientist in times where being a computer scientist meant you were basically a mathematician with a specialty. Semaphores were first introduced by him in one of his early EWDs (EWD35, http://www.cs.utexas.edu/users/EWD/ewd00xx/EWD35.PDF). At the time of EWD35, his EWDs were non-official musings, written in Dutch, intended to be shared amongst interested colleagues and such. It's not like he was writing a scientific paper.

I don't think Torvalds really meant anything much by it. He's just trying to be funny.

Post reply on HN