Homework-4 Version 0 |
|
👤 Author: by 59739640qqcom 2019-10-09 15:38:35 |
think about your possible case about process synchronization, and give out a solution for the problem.
Suppose a family are eating fruits ,dad's job is to peel apples and put apples into the basket and mother's job is to peel pear and put pears into the basket. On the contrary, son's work is to eat the apple in the basket and daughter's work is to eat the pear in the basket.The basket can only contains one fruit .
For this example ,we can get some information that dad and mother can not work together and boy and girl can not get fruit from the basket in the same time .
so we need to schedule the process :after the boy get the fruit from the basket, and mother can put fruit into the basket and girl is able to take fruit from the basket. Over this process , the boy's action is based on his father's action ,only after his father put a apple into the basket and then he can eat it.