Example of semaphore, Operating System

Assignment Help:

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)


Related Discussions:- Example of semaphore

Define drawback of distributed systems, Define drawback of Distributed syst...

Define drawback of Distributed systems Reliability is a drawback of Distributed systems

Logic gates, Determine the equation for the y and truth table for the circu...

Determine the equation for the y and truth table for the circuits

How is memory management done using bit maps?, How is memory management don...

How is memory management done using bit maps? A bit map is here in this we signify the bit value as 0 or 1. 1-hole 0-process In this we are able to represent the proce

Exdplain many-to-many model, Many-to-Many Model The many-to-many model-...

Many-to-Many Model The many-to-many model- many user-level threads to many kernel-level threads avoids several of the limitations of the one-to-one model, although extending mu

What happens when you execute a program in unix, When you run a program on ...

When you run a program on your UNIX system, the system prepares a special environment for that program. This environment owns everything needed for the system to execute the progra

Define a election algorithm, Consider a setting where processors are not as...

Consider a setting where processors are not associated with unique identifiers but the total number of processors is known and the processors are organized along a bidirectional ri

Several cpu-scheduling algorithms, Q. Several CPU-scheduling algorithms are...

Q. Several CPU-scheduling algorithms are parameterized for instance the RR algorithm requires a parameter to indicate the time slice. Multilevel response queues require parameters

Explain working of the logical file system, Explain working of the logical ...

Explain working of the logical file system The logical file system manages metadata information. Metadata contains all of the file-system structure, excluding actual data. It h

Define server processing with queues, Define Server Processing with Queues ...

Define Server Processing with Queues The efficient server processing of client request is essential for optimized client- server applications. This process is greatly enhanced

Explain message passing system, Message passing system:- The function o...

Message passing system:- The function of message system is to permit processes to communicate with one another without the requirement to resort (option) to shared data. Commun

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd