3 ms·
There are much better ways to implement a concurrent queue than the ones shown. Using locks for every single queue/dequeue is a very good way to completely kill
by hamidpalo 14y ago
There are much better ways to implement a concurrent queue than the ones shown. Using locks for every single queue/dequeue is a very good way to completely kill performance. A much better alternative is to use hand-over-hand locking, or use CAS for a lock-free implementation.
TAOMP ( http://www.amazon.com/The-Multiprocessor-Programming-Maurice-Herlihy/dp/0123705916 http://www.amazon.com/The-Multiprocessor-Programming-Maurice... ) goes over this in great detail and is overall an excellent book.
- atechie 14y agoFollowing is a great resource for Concurrent programming without locks and software transaction memory : http://www.cl.cam.ac.uk/research/srg/netos/lock-free/ http://www.cl.cam.ac.uk/research/srg/netos/lock-free/