News for hackers. Stuff that matters.
Re:Threads without locks by albertzeyer on Sunday September 05, 2010 @11:23AM (#1664640)
I'm just curious: For the channel implementation itself, of course you need locking, don't you? Or how is it possible to implement such a message queue without synchronisation?
Re:Threads without locks by papaf on Sunday September 05, 2010 @05:54PM (#1665268)
I've not done it myself, but once when I thought I'd need such a queue I found this pseudo code and references:

http://www.cs.rochester.edu/research/synchronization/pseudoc...

Re:Threads without locks by cma on Sunday September 05, 2010 @12:35PM (#1664728)
Condition variables (although somewhere underneath, locks are probably used).
Re:Threads without locks by masklinn on Sunday September 05, 2010 @04:09PM (#1665065)
If it can block, there's probably a lock.

It's also multiple-producer multiple-consumer, I'm not sure there are lockless implementations even for non-blocking versions of that.