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

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
Impact Printers and non - Impact Printers: Impact Printers: These are printers in which the print-head strikes a ribbon, and include the daisywheel and thimble printer

types of computer on the basis of shape, size & resources

draw the e r diagram for irctc rail ticket reservation online

QUESTION (a) Using diagrams, describe the 2-tier and 3-tier architectures. (b) What is a middleware? Explain the functions of a middleware. Give two examples of middleware.

QUESTION (a) You have been asked to design and implement a chat application. Which protocol would you used TCP or UDP? Justify your answer. (b) Explain why multithreading is

draw a block diagram to show organization of a computer system .explain or a units of computer system

What are two types of evidence geologists use to learn about Earth''s interior.?

Central Processing Unit: A Central Processing Unit (CPU) in a computer system is an extremely fast device as compared to the main memory, but it can not work on its own. It de

what is the computer science

Example of autonomous rational agents-Artificial intelligence The procedure of waste water treatment After the level of pollutants in waste water is find out,  following 5