Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
Essay

Semaphores

Beoordeling
-
Verkocht
-
Pagina's
1
Cijfer
A
Geüpload op
12-03-2023
Geschreven in
2022/2023

Basics of semaphore and types

Instelling
Vak

Voorbeeld van de inhoud

Semaphores proposed by Etzker Dystra are a technique to manage concurrent processes by
using a simple integer value which is known as a semaphore. Semaphores are a shared
variable and this variable will be used to solve the critical section problem and to achieve
process synchronization in the multiprocessing environment. Semaphores can be accessed by
processes through only two standard atomic operations which are weight and signal. Processes
use p to denote the weight operation and v to denote the signal operation. The weight operation
is denoted using p and v so where did this come from this is what we just saw they came from
these dutch words so when the semaphore's needs to be accessed by a process what happens
is it will check whether the variable s is less than or equal to zero. There are two types of
semaphores which we'll be discussing so based on those two kinds of sum of fours when we
explain it this will become clearer all right so remember that this weight operation is used to test
if there is any other process using the resource or if any other. If process is there in the critical
section and it is not there it will decrement the value of s.

All the modifications to the integer value of the semaphore in the weight and signal operations
must be executed indivisibly, which means that when one process modifies a value no other
processors can simultaneously modify that same value. The value of a binary semaphores can
range only between 0 and 1, so if the value is zero that means the shared resource is being
used by some other process and the currently requesting process has to wait. If the value of the
semaphore is 1, then it is free for the currently requesting process to either enter its critical
section or to use the shared resource that it wants to use. The value of sum of four will initially
be initialized to the value one, so one will be the initial value of a process. The process that
wants to currently execute in the critical section is free to do so. When s is equal to zero, what
happens? That process will not be able to enter its critical section or access the shared
resource that it wants to use, so it gets stuck there. The value of s is now one, which means that
this process is signaling other processes that I have completed using the critical section of
shared resource. Whatever it may be.

Counting semaphores are used to control access to resources that have multiple instances. It is
limited the resource will not have indefinite or infinite instances so in that way if there are
multiple instances of a particular resource then multiple processes can make use of it but again
it is limited. The counting semaphore works it is not just ranging between 0 and 1 but it will have
a range within an unrestricted domain. One process trying to use it which was stuck in this loop
so when process p1 increments is value of s what will happen this condition will now become
false. In binary semaphores we saw how it can be used to achieve mutual exclusion and in
counting sum of force we saw that how it also can also be used for accessing multiple instances
of resources. As long as resources are available the processes will be able to use them but
once they are not available once we have run out of resources then the other processors will be
unable to access that particular resource and will be stuck in this loop.

Geschreven voor

Instelling
Vak

Documentinformatie

Geüpload op
12 maart 2023
Aantal pagina's
1
Geschreven in
2022/2023
Type
ESSAY
Docent(en)
Onbekend
Cijfer
A

Onderwerpen

$11.29
Krijg toegang tot het volledige document:

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Maak kennis met de verkoper
Seller avatar
prasanna1

Maak kennis met de verkoper

Seller avatar
prasanna1 Tce
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
-
Lid sinds
3 jaar
Aantal volgers
0
Documenten
1
Laatst verkocht
-

0.0

0 beoordelingen

5
0
4
0
3
0
2
0
1
0

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen