Earlier quoted context omitted.
> This stuff was all well understood four decades ago. Much of it was forgotten outside the mainframe world, because threads and multiprocessors didn't make it to microprocessors for several more decades. Here's an important distinction to make: this stuff was well understood in theory , but the practice is a bit different. Semaphores are a neat theoretical concept but not a very good practical parallel programming p…
Using two semaphores to implement a bounded buffer has the advantage that writers and readers don't interfere with eachother until the queue is either empty or full. Of course, that might be the only good use of semaphores, and a direct implementation can be better then one using standard semaphores. Semaphores can be implemented in a way that doesn't require a spinlock in the fast path. Still not as fast as you can…
Linus Torvalds on semaphores (1999)
91–100 of 112 posts
Re: Linus Torvalds on semaphores (1999)
#92If you haven't already, follow the 'index' link (to http://yarchive.net/comp/index.html ) and bookmark that. Some very worthwhile reading there.
Re: Linus Torvalds on semaphores (1999)
#93Here'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…
I think the UNIVAC implementation of P and V that you meant to link to is in http://www.fourmilab.ch/documents/univac/fang/hsource/schpro... .
(UNIVAC assemblers were very powerful. Arbitrary computation could be done at assembly time. If you needed some precomputed table, that was the way to do it.)
Re: Linus Torvalds on semaphores (1999)
#94Re: Linus Torvalds on semaphores (1999)
#95Earlier quoted context omitted.
goto is perfectly acceptable in C code. The most common use case is for cleaning up after errors before returning, although they're also used to break out of nested loops cleanly. goto is harmful when used improperly but fine everywhere else.
I didn't mean it's a bad thing, it was a reply to some blanket statement.
fpgeek wasn't actually making a statement about goto
Re: Linus Torvalds on semaphores (1999)
#96Love vintage concurrency techniques :).
Re: Linus Torvalds on semaphores (1999)
#97Earlier quoted context omitted.
And Linus, who grew up much closer to the Netherlands than many of us, was probably aware of that. (I had forgotten it until you pointed it out.)
Actually, Linus is from Helsinki that's not exactly close to The Netherlands. There is no intrinsic connection between Finland and The Netherlands. Although the drug laws are still famous all over.
Re: Linus Torvalds on semaphores (1999)
#98The Little Book of Semaphores by Allen Downey
Re: Linus Torvalds on semaphores (1999)
#99Earlier quoted context omitted.
I think the UNIVAC implementation of P and V that you meant to link to is in http://www.fourmilab.ch/documents/univac/fang/hsource/schpro... .
Those are the assembler macros ("procs" in UNIVAC terminology) for calling the functions previously linked. (UNIVAC assemblers were very powerful. Arbitrary computation could be done at assembly time. If you needed some precomputed table, that was the way to do it.)
(FWIW, I think it's fairly normal for macro assemblers to be Turing-complete, although some of them carry it off more gracefully than others.)
Re: Linus Torvalds on semaphores (1999)
#100Earlier quoted context omitted.
What do you think an appropriate response is?
How about public shaming instead of the destruction of a career?
Or were you talking about Linus?