The producer/consumer problem is a common synchronization problem in operating systems in which producer threads store data in a buffer for consumer threads to extract and use. Synchronization is needed to assure that the buffer does not overflow or underflow, and to assure exclusive access to the buffer whenever a thread is reading/writing from/to it. A solution using semaphores is presented, followed by a solution using a monitor. Based on content from the book Operating Systems: Internals and Design Principles, by William Stallings.
Ещё видео!