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
Medium term scheduling This is component of the swapping function. Usually the swapping in decision is based on the need to manage the degree of multiprogramming. At a system t

What is an operating system process? How is it different from a program? Why do we need the concept of a process, rather than simply talk about programs running in memory? The e

what is the use of valid invalid bits in paging

Determine the task of the Pass II In a two-pass assembler Synthesize the target program is the task of the Pass II

Describe swapping technique in UNIX systems. Swapping is used to control memory contention among processes. If there is excessively much memory contention, processes are swappe

What are the advantages of Linked allocation? The benefits are a. No external fragmentation b. Size of the file does not require to be declared

MEMORY MANAGEMENT USING LINK LISTS The first one is for showing it is process or hole, second is for starting address and third is for length of the process and last is a point

Operating Systems 1. Illustrate the Microkernel Architecture with suitable diagram. 2. When Deadlock occurs? What are the Necessary Conditions for Deadlock? 3. Describe f

Write a short note on disk scheduling   One of the responsibities of operating system O/S is to use the hardware efficiently. Whenever a process requires I/O to or from the

Q. The wait() statement in every Java program examples was part of a while loop. Describe why you would always need to use a while statement when using wait() and why you would ne