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

PSEUDO CODE FOR PROGRAM, THE PROGRAM WILL CHOOSE TWO RANDOM NUMBERS,THEN PR...

THE PROGRAM WILL CHOOSE TWO RANDOM NUMBERS,THEN PRINT THEM OUT AS AN ADDITION PROBLEM.THE PROGRAM WILL THEN ASK THE USERTO ENTER THE CORRECT ANSWER.IF THE ANSWER IS CORRECT,THE PRO

Memory management, 4. Describe priority scheduling algorithm. Consider the ...

4. Describe priority scheduling algorithm. Consider the following set of processes. Show the order in which the algorithm will schedule these processes. Assume preemptive and non-p

What is a buddy system?, What is a buddy system? We are dividing the me...

What is a buddy system? We are dividing the memory as powers of two therefore the division will be 2, 4, 8, 16, 32, 64, 128, 256...i.e. in powers of 2 as well as we are selecti

Is data in a file access sequentially or randomly, Q. Give an instance of ...

Q. Give an instance of an application in which data in a file should be accessed in the following order: a. Sequentially b. Randomly Answer: a. Print the content of

Hashed page table, W hat is hashed page table & method of hashed page tabl...

W hat is hashed page table & method of hashed page table with details

Explain direct communication and indirect communication, Direct communicati...

Direct communication With direct communication each process that requires to communicate must explicitly name the recipient or sender of the communication. The send and receive

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

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

Explain clustered file organization, Clustered file organization A cl...

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

Virtual addresses, Virtual addresses are made up of two parts: the ?rst par...

Virtual addresses are made up of two parts: the ?rst part is the page number, and the second part is an offset inside that page. Suppose our pages are 4kb (4096 = 212 bytes) long,

What are the use of job queue, What are the use of job queues, ready queues...

What are the use of job queues, ready queues and device queues? As a process enters a system they are put in to a job queue. These queues having of all jobs in the system. The

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