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
up(sem)

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
Define Instance. An instance is an administrative unit in which components of R/3 systems giving one or more services are grouped together.  The services offered by a case are

Clustered file organization A clustered file is also called a B-tree-clustered file is a tree-structured file in which records with adjacent index values are clustered toget

The primary financial objective of corporation is usually taken to be the maximization of shareholder wealth. Discuss:- i. Ways in which the shareholder of a company can encour

Describe the differences among short-term, medium-term, and long-term scheduling.   Short-term (CPU scheduler)-selects from jobs in memory those jobs that are ready to execu

Scalability Scalability is the ability of the system to adapt to increased service load. A scalable system will respond more gracefully to increased load than a non scalable on

Define Virtual memory Virtual memory is employed in all major commercial operating systems

BEST FIT ALGORITHM Here scanning is for the finest fit one. Signifies it searches the entire list for the best fit position. For the process therefore in that the process will

Find the optimal solution and optimal value of the following linear program. Use both (a) the enumerating the corner points method and (b) the iso-profit line method. Also identify

What is sector sparing is proper definition

Q. Presume that you have a page-reference string for a process with m frames (initially all empty). The page-reference string has length p along with n distinct page numbers