February 2014
Beginner
1248 pages
62h 25m
English
• In a multithreaded producer/consumer relationship (p. 976), a producer thread generates data and places it in a shared object called a buffer. A consumer thread reads data from the buffer.
• Operations on a buffer data shared by a producer and a consumer should proceed only if the buffer is in the correct state. If the buffer is not full, the producer may produce; if the buffer is not empty, the consumer may consume. If the buffer is full when the producer attempts to write into it, the producer must wait until there’s space. If the buffer is empty or the previous value was already read, the consumer must wait for new data to become available.
Read now
Unlock full access