SlideShare ist ein Scribd-Unternehmen logo
1 von 50
Module 6:  Process Synchronization ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Background ,[object Object],[object Object],[object Object],[object Object]
Bounded-Buffer ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Bounded-Buffer (Cont.) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The Critical-Section Problem ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Solution to Critical-Section Problem ,[object Object],[object Object],[object Object],[object Object],[object Object]
Initial Attempts to Solve Problem ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Algorithm 1 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Algorithm 2 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Algorithm 3 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Bakery Algorithm ,[object Object],[object Object],[object Object],Critical section for n processes
Bakery Algorithm (Cont.) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Bakery Algorithm (Cont.) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Synchronization Hardware ,[object Object],[object Object],[object Object],[object Object],[object Object]
Mutual Exclusion with Test-and-Set ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Semaphore ,[object Object],[object Object],[object Object],[object Object],[object Object]
Example:  Critical Section of  n  Processes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Semaphore Implementation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Implementation (Cont.) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Semaphore as General Synchronization Tool ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Deadlock and Starvation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Two Types of Semaphores ,[object Object],[object Object],[object Object]
Implementing  S  as a Binary Semaphore ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Implementing  S  (Cont.) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Classical Problems of Synchronization ,[object Object],[object Object],[object Object]
Bounded-Buffer Problem ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Bounded-Buffer Problem (Cont.) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Bounded-Buffer Problem (Cont.) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Readers-Writers Problem ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Readers-Writers Problem (Cont.) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Dining-Philosophers Problem ,[object Object],[object Object]
Dining-Philosophers Problem (Cont.) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Critical Regions ,[object Object],[object Object],[object Object],[object Object],[object Object]
Critical Regions (Cont.) ,[object Object],[object Object]
Example – Bounded Buffer ,[object Object],[object Object],[object Object],[object Object],[object Object]
Bounded Buffer Example (Cont.) ,[object Object],[object Object]
Implementation: region  x  when  B  do  S ,[object Object],[object Object],[object Object],[object Object]
Implementation (Cont.) ,[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Monitors
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Monitors (Cont.)
Schematic view of a monitor
Monitor with condition variables
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Dining Philosophers Example
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Dining Philosophers (Cont.)
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Monitor Implementation Using Semaphores
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Monitor Implementation (Cont.)
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Monitor Implementation (Cont.)
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Monitor Implementation (Cont.)
[object Object],[object Object],[object Object],Solaris 2 Operating System

Weitere ähnliche Inhalte

Was ist angesagt?

06 lcd slides 1 - PROCESS SYNCHRONIZATION POWERPOINT
06 lcd slides 1 - PROCESS SYNCHRONIZATION POWERPOINT06 lcd slides 1 - PROCESS SYNCHRONIZATION POWERPOINT
06 lcd slides 1 - PROCESS SYNCHRONIZATION POWERPOINTAnne Lee
 
Process Synchronization
Process SynchronizationProcess Synchronization
Process Synchronizationvinay arora
 
Peterson Critical Section Problem Solution
Peterson Critical Section Problem SolutionPeterson Critical Section Problem Solution
Peterson Critical Section Problem SolutionBipul Chandra Kar
 
Critical Section Problem - Ramakrishna Reddy Bijjam
Critical Section Problem - Ramakrishna Reddy BijjamCritical Section Problem - Ramakrishna Reddy Bijjam
Critical Section Problem - Ramakrishna Reddy BijjamRamakrishna Reddy Bijjam
 
Process synchronization(deepa)
Process synchronization(deepa)Process synchronization(deepa)
Process synchronization(deepa)Nagarajan
 
Lec11 semaphores
Lec11 semaphoresLec11 semaphores
Lec11 semaphoresanandammca
 
Critical section problem in operating system.
Critical section problem in operating system.Critical section problem in operating system.
Critical section problem in operating system.MOHIT DADU
 
Mca ii os u-2 process management & communication
Mca  ii  os u-2 process management & communicationMca  ii  os u-2 process management & communication
Mca ii os u-2 process management & communicationRai University
 
Bakery algorithm
Bakery algorithmBakery algorithm
Bakery algorithmUm e Farwa
 
ITFT_Semaphores and bounded buffer
ITFT_Semaphores and bounded bufferITFT_Semaphores and bounded buffer
ITFT_Semaphores and bounded bufferSneh Prabha
 
Process synchronization
Process synchronizationProcess synchronization
Process synchronizationAli Ahmad
 
Bakery algorithm in operating system
Bakery algorithm in operating systemBakery algorithm in operating system
Bakery algorithm in operating systemMehdi Hussain
 
Semophores and it's types
Semophores and it's typesSemophores and it's types
Semophores and it's typesNishant Joshi
 

Was ist angesagt? (20)

06 lcd slides 1 - PROCESS SYNCHRONIZATION POWERPOINT
06 lcd slides 1 - PROCESS SYNCHRONIZATION POWERPOINT06 lcd slides 1 - PROCESS SYNCHRONIZATION POWERPOINT
06 lcd slides 1 - PROCESS SYNCHRONIZATION POWERPOINT
 
Process Synchronization
Process SynchronizationProcess Synchronization
Process Synchronization
 
Peterson Critical Section Problem Solution
Peterson Critical Section Problem SolutionPeterson Critical Section Problem Solution
Peterson Critical Section Problem Solution
 
Critical Section Problem - Ramakrishna Reddy Bijjam
Critical Section Problem - Ramakrishna Reddy BijjamCritical Section Problem - Ramakrishna Reddy Bijjam
Critical Section Problem - Ramakrishna Reddy Bijjam
 
Process synchronization(deepa)
Process synchronization(deepa)Process synchronization(deepa)
Process synchronization(deepa)
 
OS_Ch7
OS_Ch7OS_Ch7
OS_Ch7
 
Behavioral modeling
Behavioral modelingBehavioral modeling
Behavioral modeling
 
6 Synchronisation
6 Synchronisation6 Synchronisation
6 Synchronisation
 
Lec11 semaphores
Lec11 semaphoresLec11 semaphores
Lec11 semaphores
 
Monitors
MonitorsMonitors
Monitors
 
Critical section problem in operating system.
Critical section problem in operating system.Critical section problem in operating system.
Critical section problem in operating system.
 
Mca ii os u-2 process management & communication
Mca  ii  os u-2 process management & communicationMca  ii  os u-2 process management & communication
Mca ii os u-2 process management & communication
 
OSCh7
OSCh7OSCh7
OSCh7
 
Os3
Os3Os3
Os3
 
Bakery algorithm
Bakery algorithmBakery algorithm
Bakery algorithm
 
ITFT_Semaphores and bounded buffer
ITFT_Semaphores and bounded bufferITFT_Semaphores and bounded buffer
ITFT_Semaphores and bounded buffer
 
Process synchronization
Process synchronizationProcess synchronization
Process synchronization
 
Bakery algorithm in operating system
Bakery algorithm in operating systemBakery algorithm in operating system
Bakery algorithm in operating system
 
Semophores and it's types
Semophores and it's typesSemophores and it's types
Semophores and it's types
 
VHDL Behavioral Description
VHDL Behavioral DescriptionVHDL Behavioral Description
VHDL Behavioral Description
 

Andere mochten auch (7)

Ch1
Ch1Ch1
Ch1
 
Ch2
Ch2Ch2
Ch2
 
Ch5
Ch5Ch5
Ch5
 
Ch3
Ch3Ch3
Ch3
 
Ch4
Ch4Ch4
Ch4
 
Introduction to pc operations nc ii
Introduction to pc operations nc iiIntroduction to pc operations nc ii
Introduction to pc operations nc ii
 
Final cblm
Final cblmFinal cblm
Final cblm
 

Ähnlich wie Ch6

Chapter 6 - Process Synchronization
Chapter 6 - Process SynchronizationChapter 6 - Process Synchronization
Chapter 6 - Process SynchronizationWayne Jones Jnr
 
Process Synchronization -1.ppt
Process Synchronization -1.pptProcess Synchronization -1.ppt
Process Synchronization -1.pptjayverma27
 
Synchronization in os.pptx
Synchronization in os.pptxSynchronization in os.pptx
Synchronization in os.pptxAbdullahBhatti53
 
14- Process Synchronization.pptx
14- Process Synchronization.pptx14- Process Synchronization.pptx
14- Process Synchronization.pptxmobeenahmed49
 
Lecture_6_Process.ppt
Lecture_6_Process.pptLecture_6_Process.ppt
Lecture_6_Process.pptwafawafa52
 
Ch7 Process Synchronization galvin
Ch7 Process Synchronization galvinCh7 Process Synchronization galvin
Ch7 Process Synchronization galvinShubham Singh
 
Ch7: Process Synchronization
Ch7: Process SynchronizationCh7: Process Synchronization
Ch7: Process SynchronizationAhmar Hashmi
 
5Process Synchronization.pptx gfgfhgjg jh
5Process Synchronization.pptx gfgfhgjg jh5Process Synchronization.pptx gfgfhgjg jh
5Process Synchronization.pptx gfgfhgjg jhudaybiswas9
 
01 - DAA - PPT.pptx
01 - DAA - PPT.pptx01 - DAA - PPT.pptx
01 - DAA - PPT.pptxKokilaK25
 

Ähnlich wie Ch6 (20)

Chapter 6 - Process Synchronization
Chapter 6 - Process SynchronizationChapter 6 - Process Synchronization
Chapter 6 - Process Synchronization
 
CH05.pdf
CH05.pdfCH05.pdf
CH05.pdf
 
U3-PPT-1 (1).ppt
U3-PPT-1 (1).pptU3-PPT-1 (1).ppt
U3-PPT-1 (1).ppt
 
Operating System
Operating SystemOperating System
Operating System
 
Process Synchronization -1.ppt
Process Synchronization -1.pptProcess Synchronization -1.ppt
Process Synchronization -1.ppt
 
Synchronization in os.pptx
Synchronization in os.pptxSynchronization in os.pptx
Synchronization in os.pptx
 
14- Process Synchronization.pptx
14- Process Synchronization.pptx14- Process Synchronization.pptx
14- Process Synchronization.pptx
 
Os2
Os2Os2
Os2
 
Lecture16-17.ppt
Lecture16-17.pptLecture16-17.ppt
Lecture16-17.ppt
 
Lecture_6_Process.ppt
Lecture_6_Process.pptLecture_6_Process.ppt
Lecture_6_Process.ppt
 
Os3
Os3Os3
Os3
 
Ch7 Process Synchronization galvin
Ch7 Process Synchronization galvinCh7 Process Synchronization galvin
Ch7 Process Synchronization galvin
 
Ch7: Process Synchronization
Ch7: Process SynchronizationCh7: Process Synchronization
Ch7: Process Synchronization
 
Ipc feb4
Ipc feb4Ipc feb4
Ipc feb4
 
C# Loops
C# LoopsC# Loops
C# Loops
 
5Process Synchronization.pptx gfgfhgjg jh
5Process Synchronization.pptx gfgfhgjg jh5Process Synchronization.pptx gfgfhgjg jh
5Process Synchronization.pptx gfgfhgjg jh
 
Ch7
Ch7Ch7
Ch7
 
Daa unit 1
Daa unit 1Daa unit 1
Daa unit 1
 
01 - DAA - PPT.pptx
01 - DAA - PPT.pptx01 - DAA - PPT.pptx
01 - DAA - PPT.pptx
 
os4-2_cop.ppt
os4-2_cop.pptos4-2_cop.ppt
os4-2_cop.ppt
 

Ch6

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42. Schematic view of a monitor
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.