Concurrent Queues

This lesson presents the design and implementation of a thread-safe queue.

As you know by now, there is always a standard method to make a concurrent data structure: add a big lock. For a queue, let’s skip that approach, assuming you can figure it out.

Instead, let’s take a look at a slightly more concurrent queue designed by Michael and Scott“Nonblocking Algorithms and Preemption-safe Locking on by Multiprogrammed Shared-memory Multiprocessors. ” M. Michael, M. Scott. Journal of Parallel and Distributed Computing, Vol. 51, No. 1, 1998 Professor Scott and his students have been at the forefront of concurrent algorithms and data structures for many years; check out his web page, numerous papers, or books to find out more.. The data structures and code used for this queue can be found below.

Get hands-on with 1200+ tech skills courses.