Change the Synchronous Dual Queueclass to work correctly with null items. Exercise Consider the queue presented in Fig.10.21, a variant of the simple lock-free queue for a single enqueuer and a single...

Change the Synchronous Dual Queueclass to work correctly with null items. Exercise

Consider the queue presented in Fig.10.21, a variant of the simple lock-free queue for a single enqueuer and a single dequeuer described in Chapter3.This queue is blocking; that is, removing an item from an empty queue, or adding an item to a full one, causes the threads to spin. Surprisingly, this queue requires only loads and stores and not a more powerful read–modify–write syn chronization operation. Does the queue implementation, however, require the use of a memory barrier? If so, where in the code is such a barrier needed and why? If not, explain why not.






May 02, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here