what is Semaphore and explain with example?, Basic Computer Science

Description
A semaphore is a confined variable whose value can be accessed and changed only by the operations P and V and initialization operation known as ''Semaphoiinitislize''.
• Binary Semaphores can take for granted only the value 0 or the value 1 counting semaphores also described general semaphores can suppose only nonnegative values.

• The P (or wait or sleep or down) operation on semaphores S, assumed as P(S) or wait (S), controls as follows:
• P(S):

IF S > 0
THEN S := S - 1
ELSE (wait on S)

The V (or signal or wakeup or up) process on semaphore S, written as V(S) or signal (S), controls as follows:
V(S): IF (one or additional process are waiting on S)
THEN (let one of these processes proceed)
ELSE S := S +1

Posted Date: 5/2/2012 9:30:04 AM | Location : United States







Related Discussions:- what is Semaphore and explain with example?, Assignment Help, Ask Question on what is Semaphore and explain with example?, Get Answer, Expert's Help, what is Semaphore and explain with example? Discussions

Write discussion on what is Semaphore and explain with example?
Your posts are moderated
Related Questions
AsBased on Chapter Review Problems from the book. 1 #1. What is meant by data independence? Explain your answer. #2. Identify two benefits of separating application software fr


Question 1 Write a note on transition, transition types & Features Question 2 Describe the different types of lens used in film shooting Question 3 Briefly explain


TYPES OF PC:  In general,  basic function of all the computers is same i.e. Computers accept data as input, perform operations on these data and generates the desired output t

SMA* Search-Artificial intelligence IDA* search is good from a memory point of view. actually it may  be criticised for not using enough memory - utilizing  more memory may inc


Write a program that: 1. Ask the user for names of the two iput files and a name of an output file. The two input files contain integers in any order. Eachimput file contains no mo

Mini Computers and Micro Computers: The mini computers are intermediate in power, and may function as small mainframe computers. They are often dedicated to a particular purpo

IP provide connectionless service to upper layer IP protocol is very simple could not guarantee the reliability of transportations IP protocol is Point to Point IP provide the unif