SlideShare a Scribd company logo
1
Process Synchronization (Galvin)
Outline
 CHAPTER OBJECTIVES
 To introduce the critical-section problem, whose solutions can be used to ensure the consistency of shared data.
 To present both software and hardware solutions of the critical-section problem.
 To examine several classical process-synchronization problems.
 To explore several tools that are used to solve process synchronization problems.
 BACKGROUND
 THE CRITICAL SECTION PROBLEM
 PETERSON'S SOLUTION
 SYNCHRONIZATION HARDWARE
 MUTEX LOCKS
 SEMAPHORES
o Semaphore Usage
o Semaphore Implementation
o Deadlocks and Starvation
o Priority Inversion
 CLASSIC PROBLEMS OF SYNCHRONIZATION
o The Bounded-Buffer Problem
o The Readers–Writers Problem
o The Dining-Philosophers Problem
 MONITORS
o Monitor Usage
o Dining-Philosophers Solution
o Using Monitors
o Implementing a Monitor
o Using Semaphores
o Resuming Processes within a Monitor
 SYNCHRONIZATION EXAMPLES
o Synchronization in Windows
o Synchronization in Linux
o Synchronization in Solaris
o Pthreads Synchronization
 ALTERNATIVE APPROACHES
o Transactional Memory
o OpenMP
o Functional Programming Languages
Contents
A cooperating process is one that canaffect or be affectedbyother processes executing inthe system. Cooperating processescaneither directlyshare a
logical address space (that is, both code anddata)or be allowed to share data onlythroughfiles or messages. The former case is achievedthroughthe
use of threads, discussedinChapter 4. Concurrent accessto shareddata mayresult in data inconsistency, however. Inthis chapter, we discussvarious
mechanisms to ensure the orderlyexecution ofcooperating processesthat share a logical address space, sothat data consistencyis maintained.
BACKGROUND
 We’ve alreadyseen that processes canexecute concurrentlyor in parallel. Section 3.2.2 introducedthe role of processsched ulingand
described how the CPU scheduler switches rapidlybetween processesto provide concurrent execution. This means that one process may
onlypartiallycomplete execution before another processis scheduled. Infact, a process maybe interruptedat anypoint in its instruction
2
Process Synchronization (Galvin)
stream, andthe processing core maybe assigned to execute instructions of another process. Additionally, Section4.2 introducedparallel
execution, in whichtwo instruction streams (representing different processes) execute simultaneouslyon separate processing cores. Inthis
chapter, we explain how concurrent or parallelexecutioncan contribute to issues involving the integrityof data sharedbyseveral processes.
AssortedContent
 XXX
To be cleared
 I
Q’s Later
 XXX
Glossary
ReadLater
Further Reading
 S

Grey Areas
 XXX

More Related Content

PDF
Distributed Systems Theory for Mere Mortals
PDF
Replication in the Wild
PPTX
Multiprocessing -Interprocessing communication and process sunchronization,se...
DOCX
Process synchronization
PDF
Distributed Systems Theory for Mere Mortals - GeeCON Krakow May 2017
PPTX
Rgk cluster computing project
PPT
Java threading 2
PPTX
Inter Process Communication
Distributed Systems Theory for Mere Mortals
Replication in the Wild
Multiprocessing -Interprocessing communication and process sunchronization,se...
Process synchronization
Distributed Systems Theory for Mere Mortals - GeeCON Krakow May 2017
Rgk cluster computing project
Java threading 2
Inter Process Communication

What's hot (12)

DOCX
New Multi-Hop Clustering Algorithm for Vehicular Ad Hoc Networks
ODT
neutral architectures I N operating system
PPT
what every web and app developer should know about multithreading
PPTX
What is Modulation?
PPT
PDF
Mysql connection
PPTX
SYNCHRONIZATION IN MULTIPROCESSING
PPT
Distributed file systems (from Google)
PDF
Inter process communication
PDF
shashank_micro92_00697015
PPT
Interprocess communication (IPC) IN O.S
New Multi-Hop Clustering Algorithm for Vehicular Ad Hoc Networks
neutral architectures I N operating system
what every web and app developer should know about multithreading
What is Modulation?
Mysql connection
SYNCHRONIZATION IN MULTIPROCESSING
Distributed file systems (from Google)
Inter process communication
shashank_micro92_00697015
Interprocess communication (IPC) IN O.S
Ad

Similar to Process scheduling (20)

DOCX
Processscheduling 161001112521
DOCX
Processscheduling 161001112521
DOCX
Process synchronizationfinal
DOCX
Processscheduling 161001112521
PPTX
Lecture 9 - Process Synchronization.pptx
PPT
Multithreading in java programming language.ppt
DOC
PARALLEL ARCHITECTURE AND COMPUTING - SHORT NOTES
PDF
Concurrency in Operating system_12345678
PDF
AspectCache
PDF
Process coordination
PPT
Chapter 6-Consistency and Replication.ppt
PDF
Notes about concurrent and distributed systems & x86 virtualization
PPTX
Chapter 3 chapter reading task
PDF
Process Control Block (PCB) print 4.pdf
PDF
Producer consumer-problems
PDF
Analysis of Synchronization Mechanisms in Operating Systems
PPT
chen-06.ppt
PDF
SSBSE10.ppt
PPTX
Operating Systems R20 Unit 2.pptx
PPT
This is introduction to distributed systems for the revised curiculum
Processscheduling 161001112521
Processscheduling 161001112521
Process synchronizationfinal
Processscheduling 161001112521
Lecture 9 - Process Synchronization.pptx
Multithreading in java programming language.ppt
PARALLEL ARCHITECTURE AND COMPUTING - SHORT NOTES
Concurrency in Operating system_12345678
AspectCache
Process coordination
Chapter 6-Consistency and Replication.ppt
Notes about concurrent and distributed systems & x86 virtualization
Chapter 3 chapter reading task
Process Control Block (PCB) print 4.pdf
Producer consumer-problems
Analysis of Synchronization Mechanisms in Operating Systems
chen-06.ppt
SSBSE10.ppt
Operating Systems R20 Unit 2.pptx
This is introduction to distributed systems for the revised curiculum
Ad

More from marangburu42 (20)

DOCX
PDF
Write miss
DOCX
Hennchthree 161102111515
DOCX
Hennchthree
DOCX
Hennchthree
DOCX
Sequential circuits
DOCX
Combinational circuits
DOCX
Hennchthree 160912095304
DOCX
Sequential circuits
DOCX
Combinational circuits
DOCX
Karnaugh mapping allaboutcircuits
DOCX
Aac boolean formulae
DOCX
Virtualmemoryfinal 161019175858
DOCX
Io systems final
DOCX
File system interfacefinal
DOCX
File systemimplementationfinal
DOCX
Mass storage structurefinal
DOCX
All aboutcircuits karnaugh maps
DOCX
Virtual memoryfinal
DOCX
Mainmemoryfinal 161019122029
Write miss
Hennchthree 161102111515
Hennchthree
Hennchthree
Sequential circuits
Combinational circuits
Hennchthree 160912095304
Sequential circuits
Combinational circuits
Karnaugh mapping allaboutcircuits
Aac boolean formulae
Virtualmemoryfinal 161019175858
Io systems final
File system interfacefinal
File systemimplementationfinal
Mass storage structurefinal
All aboutcircuits karnaugh maps
Virtual memoryfinal
Mainmemoryfinal 161019122029

Recently uploaded (20)

PPTX
Newer Technologies in medical field.pptx
PPTX
Nancy Caroline Emergency Paramedic Chapter 15
PPTX
unit1-introduction of nursing education..
PPTX
Nancy Caroline Emergency Paramedic Chapter 11
PPTX
Nancy Caroline Emergency Paramedic Chapter 16
PPTX
POSTURE.pptx......,............. .........
PPTX
Public Health. Disasater mgt group 1.pptx
PPTX
Nancy Caroline Emergency Paramedic Chapter 17
PDF
Essentials of Hysteroscopy at World Laparoscopy Hospital
PPTX
BLS, BCLS Module-A life saving procedure
PPT
12.08.2025 Dr. Amrita Ghosh_Stocks Standards_ Smart_Inventory Management_GCLP...
PPTX
HIGHLIGHTS of NDCT 2019 WITH IMPACT ON CLINICAL RESEARCH.pptx
PPTX
Care Facilities Alcatel lucenst Presales
PPTX
Nancy Caroline Emergency Paramedic Chapter 1
PPTX
Nepal health service act.pptx by Sunil Sharma
PPTX
Nancy Caroline Emergency Paramedic Chapter 18
PPTX
Nancy Caroline Emergency Paramedic Chapter 14
PPTX
Understanding The Self : 1Sexual health
PPTX
guidance--unit 1 semester-5 bsc nursing.
PPTX
Vaginal Bleeding and Uterine Fibroids p
Newer Technologies in medical field.pptx
Nancy Caroline Emergency Paramedic Chapter 15
unit1-introduction of nursing education..
Nancy Caroline Emergency Paramedic Chapter 11
Nancy Caroline Emergency Paramedic Chapter 16
POSTURE.pptx......,............. .........
Public Health. Disasater mgt group 1.pptx
Nancy Caroline Emergency Paramedic Chapter 17
Essentials of Hysteroscopy at World Laparoscopy Hospital
BLS, BCLS Module-A life saving procedure
12.08.2025 Dr. Amrita Ghosh_Stocks Standards_ Smart_Inventory Management_GCLP...
HIGHLIGHTS of NDCT 2019 WITH IMPACT ON CLINICAL RESEARCH.pptx
Care Facilities Alcatel lucenst Presales
Nancy Caroline Emergency Paramedic Chapter 1
Nepal health service act.pptx by Sunil Sharma
Nancy Caroline Emergency Paramedic Chapter 18
Nancy Caroline Emergency Paramedic Chapter 14
Understanding The Self : 1Sexual health
guidance--unit 1 semester-5 bsc nursing.
Vaginal Bleeding and Uterine Fibroids p

Process scheduling

  • 1. 1 Process Synchronization (Galvin) Outline  CHAPTER OBJECTIVES  To introduce the critical-section problem, whose solutions can be used to ensure the consistency of shared data.  To present both software and hardware solutions of the critical-section problem.  To examine several classical process-synchronization problems.  To explore several tools that are used to solve process synchronization problems.  BACKGROUND  THE CRITICAL SECTION PROBLEM  PETERSON'S SOLUTION  SYNCHRONIZATION HARDWARE  MUTEX LOCKS  SEMAPHORES o Semaphore Usage o Semaphore Implementation o Deadlocks and Starvation o Priority Inversion  CLASSIC PROBLEMS OF SYNCHRONIZATION o The Bounded-Buffer Problem o The Readers–Writers Problem o The Dining-Philosophers Problem  MONITORS o Monitor Usage o Dining-Philosophers Solution o Using Monitors o Implementing a Monitor o Using Semaphores o Resuming Processes within a Monitor  SYNCHRONIZATION EXAMPLES o Synchronization in Windows o Synchronization in Linux o Synchronization in Solaris o Pthreads Synchronization  ALTERNATIVE APPROACHES o Transactional Memory o OpenMP o Functional Programming Languages Contents A cooperating process is one that canaffect or be affectedbyother processes executing inthe system. Cooperating processescaneither directlyshare a logical address space (that is, both code anddata)or be allowed to share data onlythroughfiles or messages. The former case is achievedthroughthe use of threads, discussedinChapter 4. Concurrent accessto shareddata mayresult in data inconsistency, however. Inthis chapter, we discussvarious mechanisms to ensure the orderlyexecution ofcooperating processesthat share a logical address space, sothat data consistencyis maintained. BACKGROUND  We’ve alreadyseen that processes canexecute concurrentlyor in parallel. Section 3.2.2 introducedthe role of processsched ulingand described how the CPU scheduler switches rapidlybetween processesto provide concurrent execution. This means that one process may onlypartiallycomplete execution before another processis scheduled. Infact, a process maybe interruptedat anypoint in its instruction
  • 2. 2 Process Synchronization (Galvin) stream, andthe processing core maybe assigned to execute instructions of another process. Additionally, Section4.2 introducedparallel execution, in whichtwo instruction streams (representing different processes) execute simultaneouslyon separate processing cores. Inthis chapter, we explain how concurrent or parallelexecutioncan contribute to issues involving the integrityof data sharedbyseveral processes. AssortedContent  XXX To be cleared  I Q’s Later  XXX Glossary ReadLater Further Reading  S  Grey Areas  XXX