Semaphore examples, Operating System

Ok so i think i got this right by not 100% on this. what I want to figure out is if there are x visitors that can line up for a ride but only 1 passenger can get on the ride at a time when the ride is available. If y number of rides are taken, the visitors have to wait for a ride to become available. If the ride is available but no visitor is then the ride waits.

So this is what i got so far this is all just psudo code I dont really need this to work I just need to wrap my head around the semaphore thing

Semaphore rideAvaliable = 0. rideTaken = 0, rideFilled = 0, visitorReleased = 0;


Drive around for a bit
Posted Date: 11/1/2012 9:12:47 AM | Location : United States

Related Discussions:- Semaphore examples, Assignment Help, Ask Question on Semaphore examples, Get Answer, Expert's Help, Semaphore examples Discussions

Write discussion on Semaphore examples
Your posts are moderated
Related Questions
Q. The Sun Ultra SPARC processor has numerous register sets that describe the actions of a context switch if the new context is previously loaded into one of the register sets. Wha

what is the meaning of co-operating process?

How do we keep track of where the free pieces of memory are? One idea is to maintain a set of linked-lists of free space; each linked-list will store free chunks of some given size

Explain the Resource Ownership by Platform Ownership of data items may further be complicated by concepts defined in certain operating systems. Each operating system defines "p

Explain the Spawnlp Functions Used in the NetWare Spawnlp(flags, execName, arg0,...)  The Spawnlp function is used to load  a NetWare executable file (NLM) specified by exec

Define UnixWare UnixWare manages resources at the process level. Each resource allocated to the application is actually allocated to the process representing the application. C

Q. What are two differences among user-level threads and kernel-level threads? Under what situations is one type better than the other? Answer: (1) User-level threads are un

Q. Distinguish among PCS and SCS scheduling. Answer: PCS scheduling is completed local to the process. It is how a thread library schedules threads onto available LWPs. SCS sch

KERNEL-LEVEL THREADS (KLT) In this level every thread management is done by kernel .No thread library except an API system calls to the kernel thread facility exists. The kern