Vehicle tasks using semaphores, Operating System

Gopher Gallery consists of a shopping mall and a cart ride that covers  the 150 acre habitat. There are m visitors and n single-person vehicles. Visitors  stroll around the mall at their leisure, then line up for the cart ride. When a cart is
available, it allows the single passenger to climb aboard and drives around the habitat for a random amount of time. If the n carts are all taken, then a future rider waits; if a vehicle is available but no one is waiting, then the vehicle waits.
The solution to this problem must synchronize visitor tasks and vehicle tasks using semaphores.
Below is a potential solution. Correct any issues with this code, if any exist.
Explain your position in detail.

Semaphore vehicleAvailable = 0, vehicleTaken = 0, vehicleFilled = 0, visitorReleased = 0;






Drive through habitat for some arbitrary amount of time;


Posted Date: 3/15/2013 6:34:24 AM | Location : United States

Related Discussions:- Vehicle tasks using semaphores, Assignment Help, Ask Question on Vehicle tasks using semaphores, Get Answer, Expert's Help, Vehicle tasks using semaphores Discussions

Write discussion on Vehicle tasks using semaphores
Your posts are moderated
Related Questions
A paper mill produces two grades of paper viz., X and Y. Because of raw material restrictions, it cannot produce more than 400 tons of grade X paper and 300 tons of grade Y paper i

What is an I/O subsystem? The control of devices connected to the computer is a main issue while designing operating systems. Since I/O devices differ widely in their function

Translation Look aside Buffer In a cached system, the base addresses of the last few indexed pages is maintained in registers named the TLB that adds in faster lookup. TLB has

Pure and impure interpreters      In a pure interpreter, the source program is maintained in the source form throughout its interpretation. This arrangement acquires substantia

Consider a demand-paging system with the following time-measured utilizations: CPU utilization: 10%, Paging disk: 98%, Other I/O devices: 5%. What does this imply? How to improv

Define throughput? Throughput in CPU scheduling is the number of processes that are completed per unit time. For long processes, this rate might be one process per hour; for sh

Q. In a disk jukebox what would be the result of having more open files than the number of drives in the jukebox? Answer: Two bad results could result. One likelihood is star

Give an overview of UNIX based file systems. UNIX and UNIX-like operating systems allocate a device name to each device, other than this isn't how the files on that device are

Describe the technique of packing. The physical record size will not accurately match the length of the desired logical record and the Logical records may even differ in length