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
What is an I/O subsystem? The control of devices connected to the computer is a main issue while designing operating systems. Because I/O deices differ widely in their function

Write short note on recovery regarding the file system in Windows 2000. In many file systems a power breakdown at the wrong time can damage the file system data structures so s

Q. Presume an operating system maps user-level threads to the kernel using the many-to-many model and the mapping is done through LWPs. Additionally the system allows developers to

Define memory management In multiprogramming system the user part of memory should be further subdivided to accommodate multiple processes. The task of subdivision is carried o

Define a layer that is not of an IO management module  MCS that is Management Control System is not of an IO management module

Facilities of a Debug Monitor Facilities of a debug monitor are like this: Setting breakpoints in the program Initiating a debug conversation while control reaches

Computing uses three number bases:- Binary (base 2), Octal (base 8) and Hexadecimal (base 16). Binary has been described before, although various catchphrases are used to describe

What is the sequence in which resources may be utilized? Under normal mode of operation, a process may utilize a resource in the following sequence: Request: If the requ

Explain the Peterson's solution for the critical section problem? In Peterson's solution two variables a) flag and b) turn are used as shared variables. If the both shared vari

Acyclic-graph directories An acyclic graph permits directories to have shared subdirectories and files. The similar file or subdirectory may be in two dissimilar directories. A