1. Producer-Consumer issues
There is a group of producer processes that produce products and provide these products to consumer processes to consume. To enable producer processes and consumer processes to execute concurrently,
A buffer pool with n buffers is set between the two, and the producer process puts the products it produces into a buffer; the consumer process can be
A buffer to take away the product to consume. Although all producer and consumer processes are run asynchronously, they must remain
synchronization, which does not allow the consumer process to go to an empty buffer to fetch the product, nor does it allow the producer process to a buffer that has been fully loaded and has not been taken away
Products in the market.
2. The question of the Philosopher's meal
There are five philosophers sharing a round table, sitting in the surrounding five chairs, with five bowls and five chopsticks on the round table, alternating with their lifestyles
To think and dine. Usually, a philosopher thinks, and when he is hungry, he tries to fetch the chopsticks closest to him, only when he gets two chopsticks.
To dine. After dinner, put down the chopsticks and continue to think.
3. Reader-Writer questions
A data file or record can be shared by more than one process, and we refer to a process that only requires reading the file as a "reader process", and other processes are called "write processes."
Allows multiple processes to read a shared object at the same time because the read operation does not clutter the data file. However, a write process and other reader processes or writer are not allowed
The process accesses the shared object at the same time.
"Classic Process sync Problem"