Example of semaphore, Operating System

For example, by initializing a semaphore to 0, threads can wait for an event to occur, and impose an ordering constraint, similar to a monitor using condition variables, but with memory: semaphore sem=0; // 0==locked for a semaphore

thread A
down(sem) // wait for thread B; note sem has memory!
// do stuff
thread B
// do stuff, then wake up A

Posted Date: 3/12/2013 5:23:25 AM | Location : United States

Related Discussions:- Example of semaphore, Assignment Help, Ask Question on Example of semaphore, Get Answer, Expert's Help, Example of semaphore Discussions

Write discussion on Example of semaphore
Your posts are moderated
Related Questions
function of lazy swapper

Question: a) The following questions refers to Windows XP networking: i) Briefly, explain how a host joins a network using DHCP? ii) Which IP address could be assigned to a

Since most of the programs require a lot of memory allocation/deallocation, we expect the memory management to be fast, to have low fragmentation, make good use of locality, and be

Q. What resources are utilized when a thread is created? How do they vary from those used when a process is created? Answer: For the reason that a thread is smaller than a pr

Q. Explain about Operating System Services? An operating system offers services to programs and to users of those programs. It provided by one environment for execution of

what is an operating system?

Processes have valid and invalid entries on their page tables. The valid entries all point to some where "real" (e.g. a physical page, or some portion of disk in case of non-reside

The Cigarette-Smokers difficulty Consider a system with three smoker processes and one agent process. Every smoker continuously rolls a cigarette and then smokes it. But to roll as

Problem: (a) Discuss Distributed File System Caching. (Your discussion should include the goal and architecture of distributed file system caching and the various possible c

Define ‘LRU’ page replacement policy LRU is Least Recently Used page replacement policy.