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

Assignment Help:
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


Related Discussions:- what is Semaphore and explain with example?

Execution of a machine instruction, Execution of a machine instruction: ...

Execution of a machine instruction: Execution of a machine instruction on modern processors involves a complex sequence of operations with multiple cycles. One instruction cyc

Programs, creating programs in scheme

creating programs in scheme

10, constant key use for in calculator

constant key use for in calculator

Simple Algorithm, How to make an assignment entitled "Decision Making: Fore...

How to make an assignment entitled "Decision Making: Forecasting" and I am required to make a pseudocode and flowchart based on the task.

What is atm cell, Header contains routing and error control information Pay...

Header contains routing and error control information Payload carries the actual user information, either voice, data or video

Standard Data Types, The data stored in memory can be of a lot of types. In...

The data stored in memory can be of a lot of types. In case, a person’s age is stored as a numeric value and his or her address is stored as alphanumeric characters. Python has som

What is the main principle of an operating system?, The operating system i...

The operating system is the layer among the hardware and the programs you run. It provides programs a standard interface to the hardware; or else every program would need to includ

What is nanp? explain, Question 1 What is NANP? Explain Question 2 ...

Question 1 What is NANP? Explain Question 2 What is E&M signaling? Discuss in brief Question 3 What are the common custom calling features? Question 4 Expl

Ms-powerpoint presentation for promoting national parks, Ms-PowerPoint Pres...

Ms-PowerPoint Presentation for Promoting National Parks You have been hired by Tourism Department to make a presentation to the travel agents from different countries. Design

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