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

How does user specify block to be fetched in direct access, How does user s...

How does user specify block to be fetched in direct access? By specifying the relative block number, relative to first block in file, which is block 0.

What are the different accessing methods of a file, What are the different ...

What are the different accessing methods of a file? The different types of accessing a file are: Sequential access: Information in the file is accessed sequentially

Define maintaining data on a per client basis, Define Maintaining Data on a...

Define Maintaining Data on a Per Client Basis Perhaps the most dramatic syntactical programming change for the application developer of client – server applications is maintain

Operation managmant, what is the function of operation management?

what is the function of operation management?

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

What is the exclusive feature of unix, What is the exclusive feature of UNI...

What is the exclusive feature of UNIX Shell is the exclusive feature of UNIX.

Fork system call in unix, Forking is an important phase of Unix, critical t...

Forking is an important phase of Unix, critical to the support of its design strategies, which encourages the implementation of filters. In Unix, a filter is a process that reads i

Linux OS, Ask questioDevelop a utility in C language which will run in Linu...

Ask questioDevelop a utility in C language which will run in Linux operating systems to display following properties of the system: ? Processor speed ? Ram size ? Computer name ? S

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