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
Q. Benefits and Drawbacks of Batch System? Benefits of Batch System: Move much of the work of operator to computer. Increased performance as it was possible for j

How can the deadlock be prevented Bankers algorithm : The Resource allocation graph algorithm isn't applicable to a resource allocation system with multiple instances of every

Q. What are three benefits of dynamic (shared) linkage of libraries compared to static linkage? What are two situations where static linkage is preferable? Answer: The

Normal 0 false false false EN-IN X-NONE X-NONE MicrosoftInternetExplorer4


This is a group project as described in the 'AssignmentDescription.pdf' file. I am doing a sub project which is "sub project Mobile application. Android or Apple based. Turn based

What is the use of fork and exec system calls? Fork is a system call by which a latest process is created. Exec is also a system call, which is used after a fork by one of the

shell script that accepts two directory names as arguments and delete those file in the second directory that are identical to the file in the first

Question: (a) Distinguish between local and active directory Group Policy in Windows Server 2008? (b) Describe the three areas of account Policies that can be managed thro