Introduction - If you have any usage issues, please Google them yourself
prodecer consumer
The producer consumer problem is a classic process synchronization problem that was first proposed by Dijkstra to demonstrate the proposed semaphore mechanism. Two threads executed in the same process address space, the producer thread produces the article, and then puts the item in an empty buffer for consumer thread consumption. The consumer thread gets the items from the buffer and then releases the buffer. When the producer thread produces the goods, if there is no empty buffer available, then the producer thread must wait for the consumer thread to release an empty buffer. When consumer threads consume objects, if there is no full buffer, then the consumer thread will be blocked until new items are produced.