Introduction - If you have any usage issues, please Google them yourself
Operating systems process synchronization problem, producers-consumer model code
In the same process within the address space of the two threads. Producers thread production items,
Then things placed on a empty buffer for consumers to thread consumption. Consumer line
Cheng gain items from buffer, and then release buffer. When producers thread production content
Product, if not empty buffer can be used, then producers have to wait for the consumer thread
Thread release a empty buffer. When consumer spending items thread, if not
Full buffer, so consumer thread will be blocked, until a new item to be produced
To.