Question: [25 points] Consider a system used to control entry into a ride at an amusement park. The ride is extremely popular and will only be
![[25 points] Consider a system used to control entry into a](https://s3.amazonaws.com/si.experts.images/answers/2024/09/66de5878e5623_67266de58784ace1.jpg)
[25 points] Consider a system used to control entry into a ride at an amusement park. The ride is extremely popular and will only be operated when it is full. A full load for this ride is two adults and four children. People (adults or children) are added to the system at random intervals. Before we begin to load the ride we must wait until two adults and four children are present. Then the six people (two adults and four children) can be loaded into the ride. Each person in the load must execute function load() to be loaded onto the ride. After an adult or a child has been successfully loaded (the load) function is complete) that person must signal the ride that they are loaded (signal a semaphore "wholsLoaded"), then wait (wait a semaphore loadingComplete") until all the other passengers in the load are loaded. When the ride has received signals from all the people in the load the ride signals the loadingComplete" semaphore once for each of the people in the load. When an adult or child is released from the "loadingComplete" semaphore's queue it will terminate. Write pseudo code, using processes, mutexes, and semaphores, for the functions representing the child and adult. DO NOT write the pseudo code for the ride, for generating people (adults and children) at random intervals, or for the function load() Remember that sem Wait Decrements the semaphore value If the value is >-0, the process is allowed to run its critical region Otherwise the process is blocked (put to sleep) and placed in the blocked queue semSignal Increments the semaphore value If the semaphore value
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
