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 the windowsnt, Define the WindowsNT WindowsNT provides a two-lev...

Define the WindowsNT WindowsNT provides a two-level approach to resource management: process and thread. The process is the uppermost level and contains most of the application

What is an operating system process, What is an operating system process? H...

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

Explain the various page replacement strategies, Explain the various page r...

Explain the various page replacement strategies. Page replacement-basic scheme with diagram Optimal page replacement LRU page replacement FIFO page replacement LRU

What are the characteristics of srs, What are the characteristics of SRS? ...

What are the characteristics of SRS? i. Correct - The SRS should be made up to date when appropriate requirements are identified. ii. Unambiguous - When the requirements are

Define thrashing, Define thrashing. Thrashing is the accident of high p...

Define thrashing. Thrashing is the accident of high page traffic and low CPU utilization. It is observed that the cause of thrashing is an under-commitment of memory to program

Define what an assembler is, Define what an assembler is An assembler i...

Define what an assembler is An assembler is machine dependant.

Explain the performance of demand paging, Performance of demand paging ...

Performance of demand paging Demand paging can have an important effect on the performance of a computer system. As long as there are no page faults, the effective access time

Write pseudo code to implement the pthread create wrapper, Write pseudo cod...

Write pseudo code to implement the pthread_create wrapper of the Tern memoizer. Note you need to describe your data structure for maintaining deterministic thread IDs. In addition,

Explain about spooling, Q. Explain about Spooling? Acronym for simu...

Q. Explain about Spooling? Acronym for simultaneous peripheral operations on line. Spooling denotes to putting jobs in a buffer, a special area in memory or on a disk where

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