SlideShare a Scribd company logo
19/6/2020
Welcome To Our
Presentation
29/6/2020
Synchronization
Submitted to
Submitted ByMs. Rif…
Senior Lecturer
Department of CSE
Daffodil International University
1. M…. K… : 143-15-***
2. T… H…: 143-15-***
3. Ja… Fe…: 143-15-***
Process Synchronization means sharing system
resources by processes.
3
•Race Condition.
•Critical Section.
•Mutual Exclusion
•Bounded waiting.
•Progress.
•Deadlock.
4
• Many systems provide hardware support for critical
section code.
• The critical section problem could be solved easily
in a single-processor environment if we could
disallow interrupts.
5
• A strict software approach called Mutex Locks.
• In this approach, in the entry section of code, a
LOCK is acquired over the critical resources
modified
• And used inside critical section, and in the exit
section that LOCK is released.
•As the resource is locked while a process executes
its critical section hence no other process can
access it. 6
•In 1965, Dijkstra proposed this technique.
• By using the value of a simple integer variable to
synchronize the progress of interacting processes.
• ‘This integer variable is called semaphore.’
• It is basically a synchronizing tool.
• And is accessed only through two low standard atomic
operations, wait and signal.
7
•Simple
•Works with many processes
•Can have many different critical sections with
different semaphores
•Each critical section has unique access semaphores
•Can permit multiple processes into the critical
section at once, if desirable.
8
•Priority Inversion is a big limitation os semaphores.
•Their use is not enforced, but is by convention only.
•With improper use, a process may block
indefinitely. Such a situation is called Deadlock.
9
A race condition is an undesirable situation that
occurs when a device or system attempts to perform
two or more operations at the same time, but
because of the nature of the device or system, the
operations must be done in the proper sequence to
be done correctly
10
• shared int x =3;
• process_1 () {
• x = x +1;
• print x;
• }
• process_2 () {
• x = x +1;
• print x;
• }
• probably three machine instructions. A likely translation is:
• LOAD r1 x
• ADD r1+1 r1
• STORE r1 x 11
12
13
•Non shareable mode of Shared resources
14
•Out of a group of cooperating processes, only one
process can be in its critical section at a given point
of time.
15
•int flag;
•void enter_region(int process) {
•while ( flag == 1 );
•flag = 1;
•}
•void leave_region(int process) {
•flag = 0;
•}
16
•If no process is in its critical section
• And if one or more threads want to execute their
critical section.
• Then any one of these threads must be allowed to
get into its critical section.
17
•After a process makes a request for getting into its
critical section
•There is a limit for how many other processes can
get into their critical section, before this process's
request is granted.
• So, after the limit is reached, system must grant the
process permission to get into its critical section.
18
•Indefinite postponement of a process
• Because it requires some resource. but the
resource is never allocated to this process. It is
sometimes called livelock.
19
Five philosophers sit at a round table and in the
centre lies a plate of spaghetti that is available to
everyone.
There are chopsticks on the table { one between
each Philosopher.
20
• Think (because they are philosophers)
• Eat (as they are hungry) and
• Wait (two chopsticks are need to eat spaghetti but
only 5 are available)
21
 The sections of code where more than one process
are accessing shared resources at a time.
Where shared resources are protected.
22
•For solving this problem following conditions must
be Satisfied.
•i) Mutual Exclusion
•ii) Progress
•iii) Bounded Waiting
23
24
Is a situation in which two computer programs
shares same resources are effectively preventing
each other from accessing the resource.
25
In OS a deadlock occurs when
a process or thread enters a waiting state,
•Because a requested system resource is held by
another waiting process,
• Which in turn is waiting for another resource held
by another waiting process.
26
27
Deadlock occurs if the following conditions hold
simultaneously:
•Mutual exclusion: only one process can use a
resource at a time.
•Hold and wait: Processes are allowed to request for
new resources without releasing the resources that
they are currently holding.
•No-preemption: If a process has a resource , cannot
be preempted.
•Circular-wait: Two or more processes from a circular
chain. 28
29
30
•Prevention
•Avoidance
•Detection and recovery
31
32

More Related Content

Similar to Synchronization

Mutual exclusion and sync
Mutual exclusion and syncMutual exclusion and sync
Mutual exclusion and sync
Dr. C.V. Suresh Babu
 
Process coordination
Process coordinationProcess coordination
Process coordination
Sweta Kumari Barnwal
 
Process synchronization
Process synchronizationProcess synchronization
Process synchronization
Ali Ahmad
 
Ipc feb4
Ipc feb4Ipc feb4
Ipc feb4
Ruchi Sharma
 
Coordination and Agreement .ppt
Coordination and Agreement .pptCoordination and Agreement .ppt
Coordination and Agreement .ppt
SOURAVKUMAR723356
 
BIL406-Chapter-9-Synchronization and Communication in MIMD Systems.ppt
BIL406-Chapter-9-Synchronization and Communication in MIMD Systems.pptBIL406-Chapter-9-Synchronization and Communication in MIMD Systems.ppt
BIL406-Chapter-9-Synchronization and Communication in MIMD Systems.ppt
Kadri20
 
Interprocess Communication
Interprocess CommunicationInterprocess Communication
Interprocess Communication
Dilum Bandara
 
3.6 Deadlock-operating system unit 3.pptx
3.6 Deadlock-operating system unit 3.pptx3.6 Deadlock-operating system unit 3.pptx
3.6 Deadlock-operating system unit 3.pptx
svulasal
 
Chapter00000000
Chapter00000000Chapter00000000
Chapter00000000
Mani Deepak Choudhry
 
Operating system Deadlock
Operating system DeadlockOperating system Deadlock
Ch5 process synchronization
Ch5   process synchronizationCh5   process synchronization
Ch5 process synchronization
Welly Dian Astika
 
Lecture 5 inter process communication
Lecture 5 inter process communicationLecture 5 inter process communication
Lecture 5 inter process communication
Kumbirai Junior Muzavazi
 
Intro Basic of OS .ppt
Intro Basic of OS .pptIntro Basic of OS .ppt
Intro Basic of OS .ppt
Varsha506533
 
3 (1) [Autosaved].ppt
3 (1) [Autosaved].ppt3 (1) [Autosaved].ppt
3 (1) [Autosaved].ppt
amadayshwan
 
The Functions of the Operating System
The Functions of the Operating SystemThe Functions of the Operating System
The Functions of the Operating System
andyr91
 
Operating system 27 semaphores
Operating system 27 semaphoresOperating system 27 semaphores
Operating system 27 semaphores
Vaibhav Khanna
 
Process synchronization in Operating Systems
Process synchronization in Operating SystemsProcess synchronization in Operating Systems
Process synchronization in Operating Systems
Ritu Ranjan Shrivastwa
 
OS-Part-06.pdf
OS-Part-06.pdfOS-Part-06.pdf
OS-Part-06.pdf
NguyenTienDungK17HL
 
Ipc feb4
Ipc feb4Ipc feb4
Ipc feb4
yashnand
 
How Operating system works.
How Operating system works. How Operating system works.
How Operating system works.
Fahad Farooq
 

Similar to Synchronization (20)

Mutual exclusion and sync
Mutual exclusion and syncMutual exclusion and sync
Mutual exclusion and sync
 
Process coordination
Process coordinationProcess coordination
Process coordination
 
Process synchronization
Process synchronizationProcess synchronization
Process synchronization
 
Ipc feb4
Ipc feb4Ipc feb4
Ipc feb4
 
Coordination and Agreement .ppt
Coordination and Agreement .pptCoordination and Agreement .ppt
Coordination and Agreement .ppt
 
BIL406-Chapter-9-Synchronization and Communication in MIMD Systems.ppt
BIL406-Chapter-9-Synchronization and Communication in MIMD Systems.pptBIL406-Chapter-9-Synchronization and Communication in MIMD Systems.ppt
BIL406-Chapter-9-Synchronization and Communication in MIMD Systems.ppt
 
Interprocess Communication
Interprocess CommunicationInterprocess Communication
Interprocess Communication
 
3.6 Deadlock-operating system unit 3.pptx
3.6 Deadlock-operating system unit 3.pptx3.6 Deadlock-operating system unit 3.pptx
3.6 Deadlock-operating system unit 3.pptx
 
Chapter00000000
Chapter00000000Chapter00000000
Chapter00000000
 
Operating system Deadlock
Operating system DeadlockOperating system Deadlock
Operating system Deadlock
 
Ch5 process synchronization
Ch5   process synchronizationCh5   process synchronization
Ch5 process synchronization
 
Lecture 5 inter process communication
Lecture 5 inter process communicationLecture 5 inter process communication
Lecture 5 inter process communication
 
Intro Basic of OS .ppt
Intro Basic of OS .pptIntro Basic of OS .ppt
Intro Basic of OS .ppt
 
3 (1) [Autosaved].ppt
3 (1) [Autosaved].ppt3 (1) [Autosaved].ppt
3 (1) [Autosaved].ppt
 
The Functions of the Operating System
The Functions of the Operating SystemThe Functions of the Operating System
The Functions of the Operating System
 
Operating system 27 semaphores
Operating system 27 semaphoresOperating system 27 semaphores
Operating system 27 semaphores
 
Process synchronization in Operating Systems
Process synchronization in Operating SystemsProcess synchronization in Operating Systems
Process synchronization in Operating Systems
 
OS-Part-06.pdf
OS-Part-06.pdfOS-Part-06.pdf
OS-Part-06.pdf
 
Ipc feb4
Ipc feb4Ipc feb4
Ipc feb4
 
How Operating system works.
How Operating system works. How Operating system works.
How Operating system works.
 

Recently uploaded

BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
Nguyen Thanh Tu Collection
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
Dr. Mulla Adam Ali
 
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
สมใจ จันสุกสี
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
Solutons Maths Escape Room Spatial .pptx
Solutons Maths Escape Room Spatial .pptxSolutons Maths Escape Room Spatial .pptx
Solutons Maths Escape Room Spatial .pptx
spdendr
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
imrankhan141184
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
siemaillard
 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
TechSoup
 
math operations ued in python and all used
math operations ued in python and all usedmath operations ued in python and all used
math operations ued in python and all used
ssuser13ffe4
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
Nguyen Thanh Tu Collection
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Denish Jangid
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
iammrhaywood
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
Celine George
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
TechSoup
 
Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...
PsychoTech Services
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Fajar Baskoro
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
adhitya5119
 

Recently uploaded (20)

BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
 
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
Solutons Maths Escape Room Spatial .pptx
Solutons Maths Escape Room Spatial .pptxSolutons Maths Escape Room Spatial .pptx
Solutons Maths Escape Room Spatial .pptx
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
 
math operations ued in python and all used
math operations ued in python and all usedmath operations ued in python and all used
math operations ued in python and all used
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
 
Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
 

Synchronization

  • 2. 29/6/2020 Synchronization Submitted to Submitted ByMs. Rif… Senior Lecturer Department of CSE Daffodil International University 1. M…. K… : 143-15-*** 2. T… H…: 143-15-*** 3. Ja… Fe…: 143-15-***
  • 3. Process Synchronization means sharing system resources by processes. 3
  • 4. •Race Condition. •Critical Section. •Mutual Exclusion •Bounded waiting. •Progress. •Deadlock. 4
  • 5. • Many systems provide hardware support for critical section code. • The critical section problem could be solved easily in a single-processor environment if we could disallow interrupts. 5
  • 6. • A strict software approach called Mutex Locks. • In this approach, in the entry section of code, a LOCK is acquired over the critical resources modified • And used inside critical section, and in the exit section that LOCK is released. •As the resource is locked while a process executes its critical section hence no other process can access it. 6
  • 7. •In 1965, Dijkstra proposed this technique. • By using the value of a simple integer variable to synchronize the progress of interacting processes. • ‘This integer variable is called semaphore.’ • It is basically a synchronizing tool. • And is accessed only through two low standard atomic operations, wait and signal. 7
  • 8. •Simple •Works with many processes •Can have many different critical sections with different semaphores •Each critical section has unique access semaphores •Can permit multiple processes into the critical section at once, if desirable. 8
  • 9. •Priority Inversion is a big limitation os semaphores. •Their use is not enforced, but is by convention only. •With improper use, a process may block indefinitely. Such a situation is called Deadlock. 9
  • 10. A race condition is an undesirable situation that occurs when a device or system attempts to perform two or more operations at the same time, but because of the nature of the device or system, the operations must be done in the proper sequence to be done correctly 10
  • 11. • shared int x =3; • process_1 () { • x = x +1; • print x; • } • process_2 () { • x = x +1; • print x; • } • probably three machine instructions. A likely translation is: • LOAD r1 x • ADD r1+1 r1 • STORE r1 x 11
  • 12. 12
  • 13. 13
  • 14. •Non shareable mode of Shared resources 14
  • 15. •Out of a group of cooperating processes, only one process can be in its critical section at a given point of time. 15
  • 16. •int flag; •void enter_region(int process) { •while ( flag == 1 ); •flag = 1; •} •void leave_region(int process) { •flag = 0; •} 16
  • 17. •If no process is in its critical section • And if one or more threads want to execute their critical section. • Then any one of these threads must be allowed to get into its critical section. 17
  • 18. •After a process makes a request for getting into its critical section •There is a limit for how many other processes can get into their critical section, before this process's request is granted. • So, after the limit is reached, system must grant the process permission to get into its critical section. 18
  • 19. •Indefinite postponement of a process • Because it requires some resource. but the resource is never allocated to this process. It is sometimes called livelock. 19
  • 20. Five philosophers sit at a round table and in the centre lies a plate of spaghetti that is available to everyone. There are chopsticks on the table { one between each Philosopher. 20
  • 21. • Think (because they are philosophers) • Eat (as they are hungry) and • Wait (two chopsticks are need to eat spaghetti but only 5 are available) 21
  • 22.  The sections of code where more than one process are accessing shared resources at a time. Where shared resources are protected. 22
  • 23. •For solving this problem following conditions must be Satisfied. •i) Mutual Exclusion •ii) Progress •iii) Bounded Waiting 23
  • 24. 24
  • 25. Is a situation in which two computer programs shares same resources are effectively preventing each other from accessing the resource. 25
  • 26. In OS a deadlock occurs when a process or thread enters a waiting state, •Because a requested system resource is held by another waiting process, • Which in turn is waiting for another resource held by another waiting process. 26
  • 27. 27
  • 28. Deadlock occurs if the following conditions hold simultaneously: •Mutual exclusion: only one process can use a resource at a time. •Hold and wait: Processes are allowed to request for new resources without releasing the resources that they are currently holding. •No-preemption: If a process has a resource , cannot be preempted. •Circular-wait: Two or more processes from a circular chain. 28
  • 29. 29
  • 30. 30
  • 32. 32