Correct the code for visitor and vehicle portion, 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, a single passenger may climb aboard and drive 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 for the Visitor and Vehicle portions (assume that other portions of the system admit the tasks to the system). 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/25/2013 2:10:11 AM | Location : United States

Related Discussions:- Correct the code for visitor and vehicle portion, Assignment Help, Ask Question on Correct the code for visitor and vehicle portion, Get Answer, Expert's Help, Correct the code for visitor and vehicle portion Discussions

Write discussion on Correct the code for visitor and vehicle portion
Your posts are moderated
Related Questions
Question 1 What is Micro-kernel? What are the benefits of Micro-kernel? Question 2 Explain seven state process models used for OS with necessary diagram. Differentiate betwee

Q. Show that a few schedules are possible under the two-phase locking protocol however not possible under the timestamp protocol and vice versa. Answer: A schedule that is auth

What are Tree-structured directories We can generalize the directory structure to a tree of arbitrary height. This permits the user to create their own sub directories and to c

explain any four types of operating system feature and structure(design)


What are the different types of semaphore? Principally the semaphore is able to be classified into two on the basis of their values a)      Counting semaphore: In counting s

What are a safe state and an unsafe state? Answer:  A state is safe if the system can allocate resources to every process in some order and still avoid a deadlock. A system is

What is sector sparing? Low-level formatting also sets aside extra sectors not visible to the operating system. The controller can be told to change each bad sector logically w

Explain Swapping Swapping is a method of temporarily removing inactive programs from the memory of computer system.

Determine how Action implementing instruction’s meaning are a actually carried out   Action implementing meaning of instruction are a actually carried out Instruction executio