Write a note on the usage of semaphores, Operating System

Assignment Help:

Write a note on the usage of semaphores.

Semaphore is a synchronization tool and it is a variable having integer values. It is accessed only by two standard atomic operations wait and signal. These operation were initially termed p(for wait) and v(for signal).

                The traditional definition for wait in pseudocode is:

 

                             wait(s)  {

                                         while(s<=0)

                                           ;//no-op

                                         s--;

                                          }

             The traditional definition for signal in pseudo code is:

 

                            signal(s) {

                                             s++;

                                           }

Alteration to the integer value of the semaphore in the wait and signal operations should be executed indivisibly. i.e., when one process alters the semaphore value .No other process is able to simultaneously modify that same semaphore value. Additionally in the case of wait(s) the testing of the integer value of s (s<=0) and its possible modification (s--) must as well be executed without interruption.


Related Discussions:- Write a note on the usage of semaphores

What are the different thread levels?, What are the different thread levels...

What are the different thread levels? There are two broad type of thread implementation: User-Level Threads -- Thread Libraries. Kernel-level Threads -- System Calls.

Explain about memory-management scheme, Q. In the IBM/370 memory protectio...

Q. In the IBM/370 memory protection is offered through the use of keys. A key is a 4-bit quantity every 2K block of memory has a key (the storage key) associated with it. The CPU

How virtual memory is implemented, How Virtual memory is implemented Vi...

How Virtual memory is implemented Virtual memory can be implemented along with Segmentation and Paging

Permanently starves cpu-bound programs, Q. Presume that a scheduling algori...

Q. Presume that a scheduling algorithm at the level of short-term CPU scheduling favours those processes that have used the least processor time in the recent past. Why this algori

Implementation of modern memory management system , Central to implementati...

Central to implementation of a modern memory management system is the page replacement algorithm. Modern virtual memory systems break memory up into pages and map (via a page table

Estimation the number of input - output per second, Q. Remapping of bad bl...

Q. Remapping of bad blocks by sector sparing or else sector slipping could influence performance. Presume that the drive in Subsequent Exercise has a total of 100 bad sectors at r

Explain the protection problems, Q. In some systems a subdirectory is able...

Q. In some systems a subdirectory is able to be read and written by an authorized user just as ordinary files can be. a. Explain the protection problems that could arise. b.

Explain fifo page replacement, FIFO page replacement This is the easie...

FIFO page replacement This is the easiest page replacement algorithm. At this juncture the 1 st page entering is the 1 st to leave that is the oldest page leaves. To execute

Define process swapping , Swapping : Whole process is moved from the swap...

Swapping : Whole process is moved from the swap machine to the main memory for execution. Process size must be equal or less than to the used main memory. It is easier to exe

What are files and explain the access methods for files, What are files and...

What are files and explain the access methods for files? File definition Attributes, operations and types Direct access Sequential access with diagram Other access

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