ALL > Computer and Education > courses > university courses > undergraduate courses > Operating System > ZSTU class(2019-2020-1) > student directories > 2017329621029 方一凡 >
Homework-4 Version 0
👤 Author: by 390645143qqcom 2019-11-28 03:23:28
think about your possible case about process synchronization, and give out a solution for the problem.

Problem:

On the bus, the driver's job is to start the vehicle, drive normally, and stop at the station; the job of the conductor is to close, sell, and open.How drivers and conductors work to ensure passenger safety?

Solution:

In order to ensure the safety of the vehicle, the conductor must close the door, and then notify the driver to start the vehicle. During the driving process, the conductor cannot open the door. After the vehicle arrives at the stop, the driver informs the conductor to open the door. To this end, two semaphores S1 and S2 are required to control the behavior of the driver and the conductor. The initial values are 0.

Please login to reply. Login

Reversion History

Loading...
No reversions found.