/
wait(empty);     remove an item;     if (buffer was full) wait(empty);     remove an item;     if (buffer was full)

wait(empty); remove an item; if (buffer was full) - PDF document

mitsue-stanley
mitsue-stanley . @mitsue-stanley
Follow
398 views
Uploaded On 2015-10-19

wait(empty); remove an item; if (buffer was full) - PPT Presentation

Acquirelock insert an item to q SignalEmpty Releaselock Item GetItemQueue q Item item Acquire lock while q is empty Wait lock Empty remove an item ID: 165527

Acquire(lock);

Share:

Link:

Embed:

Download Presentation from below link

Download Pdf The PPT/PDF document "wait(empty); remove an item; if ..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

wait(empty); remove an item; if (buffer was full) Acquire(lock); insert an item to q; Signal(Empty); Release(lock); } Item GetItem(Queue q) { Item item; Acquire( lock ); while ( q is empty ) Wait( lock, Empty); remove an item; Release( lock ); return item; }