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?

Graphs, Find the corresponding matrix of the digraph above

Find the corresponding matrix of the digraph above

Java programming, Write a program that lets the user play the game Rock, Pa...

Write a program that lets the user play the game Rock, Paper, Scissors against the computer. The program should work as follows: ? When the program begins, the results of the prev

Explain TCP and UDP features in detail and compare, Which applications requ...

Which applications require TCP and why? Also specify which applications require UDP and why? A4) TCP is also known as connection-oriented: setup required between client and server

Word processing (wp), Word Processing (WP): Word Processing is one of ...

Word Processing (WP): Word Processing is one of the most widespread application software types in use today. Developed as a successor to primitive text editors that were popul

Sequential-access memory device, Sequential-access memory device: A  S...

Sequential-access memory device: A  Sequential-access  memory device reads data in sequence. In other words, information on a serial device can only be retrieved in the same s

What is Shortest-Remaining-Time (SRT) Scheduling?, • The SRT is the preemp...

• The SRT is the preemptive complement of SJF and helpful in time-sharing environment. • In SRT scheduling, the process with the least estimated run-time to completion is run next,

Describe the binary search algorithm, QUESTION 1 Describe the binary se...

QUESTION 1 Describe the binary search algorithm using an example of your own. QUESTION 2 (a) By showing all your workings, give a big-O estimate for f(x) = (x + 1)lo

Assignment 4: Cloud Computing to the Rescue, The cost of building and maint...

The cost of building and maintaining an organizational computing ecosystem has become a bigger part of most organizations’ budgets. Organizations have been looking for ways to redu

Html, a program to create htmlpage

a program to create htmlpage

Network, Give a topology (network diagram) in which there is a link whose f...

Give a topology (network diagram) in which there is a link whose failure will change many routes. Give one in which there is a link whose failure will not change any routes

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