below. It uses a semaphore car wash, to represent whether there is space left in the car wash for more drivers. S1, S2, and S3 are labels identifying the line code. (a) (40 marks) There are six drivers, A, B, C, D, E, and F that want to wash their car. Each driver operates according to the above code. Your task is to give an execution trace that contains both of the following: The trace should show what happens when there are less than four drivers in the car wash and one or more of them leave. The trace should show what happens when there are four drivers in the carwash and another driver, or several drivers want to enter. The trace must start with an empty car wash and show all the steps of each of the drivers as they enter/leave. You must show the value of carwash after each wait or signal step. Ensure that you state the initial value of car wash. If a wait operation executes, indicate whether the process succeeds or is placed in the queue. If a signal operation executes, indicate whether the value is changed, or a sleeping process is woken up. Each line of your trace should have the following format:Statement executed including which Driver process (e.g., M.S1 means that the driver named M executed statement S1); the value of the carwash semaphore (e.g., carwash=2); whether the wait succeeded or was placed in the queue/ whether the signal changed the semaphore value or a sleeping process woke up.For example: M.S1; car wash=2; wait succeeded. (b) (20 marks) The code has now been modified. Each time a driver enters the car wash, an integer total Entered is incremented. The variable is initially0. The new code is given below: The code given has a problem. The drivers have found that sometimes the total Entered value does not reflect the actual number of drivers who have entered the car wash.
Fig: 1
Fig: 2
Fig: 3
Fig: 4
Fig: 5
Fig: 6
Fig: 7
Fig: 8
Fig: 9
Fig: 10
Fig: 11
Fig: 12