News for hackers. Stuff that matters.
Re:Linus Torvalds on semaphores (1999) by exDM69 on Wednesday December 17, 2014 @05:48AM (#8761846)
> Alternatives exist. For example: message passing, and STM (software transactional memory). Anybody know of other alternatives?

It should be noted that spinlocks, mutexes and conditions (and semaphores) are building blocks that are necessary to implement message passing, software transactional memory and other non-trivial parallel programming constructs. (at least until we have practical hardware transactional memory).

Spinlocks, mutexes and conditions are a "necessary evil", not "considered harmful".

Re:Linus Torvalds on semaphores (1999) by kragen on Wednesday December 17, 2014 @01:09PM (#8763410)
You can implement message passing, STM, BSP, data parallelism, etc., on top of spinlocks, or on top of other implementations of mutexes such as condition variables, or on top of semaphores; but you can also implement them on top of primitives like compare-and-swap, which is arguably even harder to use correctly.
Re:Linus Torvalds on semaphores (1999) by fpgeek on Wednesday December 17, 2014 @11:39AM (#8762885)
If you're talking about building blocks, goto is also a necessary evil...
Re:Linus Torvalds on semaphores (1999) by nocman on Wednesday December 17, 2014 @11:57AM (#8762997)
Oh, nice turnaround!

That one was funnier then the orignal pun. Nicely done. :D

Re:Linus Torvalds on semaphores (1999) by xxs on Wednesday December 17, 2014 @11:49AM (#8762947)
You will be surprised at the goto use in the linux kernel...
Re:Linus Torvalds on semaphores (1999) by tonysuper on Wednesday December 17, 2014 @01:21PM (#8763469)
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.

Re:Linus Torvalds on semaphores (1999) by xxs on Wednesday December 17, 2014 @01:44PM (#8763589)
I didn't mean it's a bad thing, it was a reply to some blanket statement.
Re:Linus Torvalds on semaphores (1999) by Dylan16807 on Wednesday December 17, 2014 @02:16PM (#8763756)
I think you missed that fpgeek was turning exDM69's comment around on itself to put goto and spinlock into the same category.

fpgeek wasn't actually making a statement about goto