3 ms·
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
by albertzeyer 16y ago
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?
- cma 16y agoCondition variables (although somewhere underneath, locks are probably used).
- masklinn 16y agoIf 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.
- papaf 16y agoI'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/pseudocode/queues.html http://www.cs.rochester.edu/research/synchronization/pseudoc...