100% tevredenheidsgarantie Direct beschikbaar na je betaling Lees online óf als PDF Geen vaste maandelijkse kosten 4,6 TrustPilot
logo-home
College aantekeningen

Inter-process communication in operating systems

Beoordeling
-
Verkocht
-
Pagina's
24
Geüpload op
30-12-2022
Geschreven in
2021/2022

In these notes, Covered all the topics of operating systems briefly. COs - Analyze the structure of OS and basic architectural components involved in OS design. Compare and contrast various CPU scheduling algorithms. Evaluate the requirements for the process synchronization and co-ordination in the contemporary operating system. Analyze various algorithms for memory management, I/O management and security aspects of operating system. Write shell scripts in Unix/Linux O.S and write simple programs using kernel system calls. Also understand virtualization concept

Meer zien Lees minder
Instelling
Vak










Oeps! We kunnen je document nu niet laden. Probeer het nog eens of neem contact op met support.

Geschreven voor

Instelling
Vak

Documentinformatie

Geüpload op
30 december 2022
Aantal pagina's
24
Geschreven in
2021/2022
Type
College aantekeningen
Docent(en)
Ymk sir
Bevat
Alle colleges

Onderwerpen

Voorbeeld van de inhoud

3 – IPC

(1) Define following terms.
Race Condition
• Race condition can be defined as situation where two or more processes are reading
or writing some shared data and the final result depends on who runs precisely
when (their relative execution order).
Mutual Exclusion
• It is a way of making sure that if one process is using a shared variable or file; the
other process will be excluded (stopped) from doing the same thing.
Turnaround Time
• Time required to complete execution of process is known as turnaround time.
• Turnaround time = Process finish time – Process arrival time.
Throughput
• Number of processes completed per time unit is called throughput.
Critical Section
• The part of program or code of segment of a process where the shared resource is
accessed is called critical section.
Waiting time
• It is total time duration spent by a process waiting in ready queue.
• Waiting time = Turnaround time – Actual execution time.
Response Time
• It is the time between issuing a command/request and getting output/result.


(2) Explain different mechanisms for achieving mutual exclusion with busy waiting.
Disabling interrupts
• In this mechanism a process disables interrupts before entering the critical section
and enables the interrupt immediately after exiting the critical section.
while( true )
{
< disable interrupts >;
< critical section >;
< enable interrupts >;
< remainder section>; }

1

, 3 – IPC
• Mutual exclusion is achieved because with interrupts disabled, no clock interrupts
can occur.
• The CPU is only switched from process to process as a result of clock or other
interrupts, and with interrupts turned off the CPU will not be switched to another
process.
• Thus, once a process has disabled interrupts, it can examine and update the shared
memory without fear that any other process will intervene.
• This approach is generally unattractive because it is unwise to give user processes
the power to turn off interrupts.
• Suppose that one of them did it and never turned them on again? That could be the
end of the system.
• Furthermore if the system is a multiprocessor, with two or more CPUs, disabling
interrupts affects only the CPU that executed the disable instruction. The other ones
will continue running and can access the shared memory.
• On the other hand, it is frequently convenient for the kernel itself to disable
interrupts for a few instructions while it is updating variables or lists.
• If an interrupt occurred while the list of ready processes, for example, was in an
inconsistent state, race conditions could occur.
• The conclusion is: disabling interrupts is often a useful technique within the
operating system itself but is not appropriate as a general mutual exclusion
mechanism for user processes.


Shared lock variable:
• In this mechanism there is a shared variable lock having value 0 or 1.
• Before entering in to critical region a process check a shared variable lock’s value.
• If the value of lock is 0 then set it to 1 before entering the critical section and enters
into critical section and set it to 0 immediately after leaving the critical section.
While (true)
{
< set shared variable to 1>;
< critical section >;
< set shared variable to 0>;
< remainder section>;
}



2

, 3 – IPC
• If it is 1, means some other process is inside the critical section so, the process
requesting to enter the critical region will have to wait until it becomes zero.
• This mechanism suffers the same problem (race condition). If process P0 sees the
value of lock variable 0 and before it can set it to 1, context switching occurs.
• Now process P1 runs and finds value of lock variable 0, so it sets value to 1, enters
critical region.
• At the same point of time P0 resumes, sets the value of lock variable to 1, enters
critical region.
• Now two processes are in their critical regions accessing the same shared memory,
which violates the mutual exclusion condition.


Strict Alteration:




Process 1 Process 2
• In this proposed solution, the integer variable 'turn' keeps track of whose turn is to
enter the critical section.
• Initially turn=0. Process 1 inspects turn, finds it to be 0, and enters in its critical
section. Process 2 also finds it to be 0 and therefore sits in a loop continually testing
'turn' to see when it becomes 1.
• Continuously testing a variable waiting for some value to appear is called the busy
waiting.
• When process 1 exit from critical region it set turn to 1 and now process 2 can find it
to be 1 and enters in to critical region.
• In this way both the process get alternate turn to enter in critical region.
• Taking turns is not a good idea when one of the processes is much slower than the
other.
• Consider the following situation for two processes P0 and P1


3
€5,05
Krijg toegang tot het volledige document:

100% tevredenheidsgarantie
Direct beschikbaar na je betaling
Lees online óf als PDF
Geen vaste maandelijkse kosten

Maak kennis met de verkoper
Seller avatar
vaibhav51ppsv2020

Ook beschikbaar in voordeelbundel

Maak kennis met de verkoper

Seller avatar
vaibhav51ppsv2020 C.K.Pithawala school of engineering and techonology
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
0
Lid sinds
3 jaar
Aantal volgers
0
Documenten
14
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

Veelgestelde vragen