SlideShare a Scribd company logo
Operating System
Presented By : Chirag Parmar(115333)
Vijay Raval(115356)
Dining Philosopher Problem
Org. :Gujarat Vidyapith
Content
 Introduction
 DeadLocks
 Problem
 Solution
Introduction
 The dining philosophers problem is an example problem often
used in concurrent algorithm design to illustrate synchronization
issues and techniques for resolving them.
 It was originally formulated in 1965 by Edsger Dijkstra as a student
exam exercise, presented in terms of computers competing for
access to tape drive peripherals. Soon after, Tony Hoare gave the
problem its present formulation.
What is Concurrent ?
 concurrency is the decomposability property of a program,
algorithm, or problem into order-independent or partially
ordered components or units
 This means that even if the concurrent units of the program,
algorithm, or problem are executed out-of-order or in partial
order, the final outcome will remain the same.
 This allows for parallel execution of the concurrent units, which
can significantly improve overall speed of the execution in multi-
processor and multi-core systems
What is Synchronization ?
 synchronization refers to one of two distinct but related
concepts:
1. synchronization of processes
2. synchronization of data.
 Process synchronization:
 Process synchronization refers to the idea that multiple processes are to
join up or handshake at a certain point, in order to reach an agreement or
commit to a certain sequence of action.
 Data synchronization :
 Data synchronization refers to the idea of keeping multiple copies of a
dataset in coherence with one another, or to maintain data integrity.
What is DeadLock ?
 Deadlock is a state in which each member of a group of actions,
is waiting for some other member to release a lock.
 Deadlock is a common problem
in multiprocessing systems, parallel computing, and distributed
systems, where software and hardware locks are used to handle
shared resources and implement process synchronization.
Problem Statement
 Five silent philosophers sit at a round table with bowls of
spaghetti. Forks are placed between each pair of adjacent
philosophers
 Each philosopher must alternately think and eat. However, a
philosopher can only eat spaghetti when they have both left and
right forks.
 Each fork can be held by only one philosopher and so a philosopher
can use the fork only if it is not being used by another
philosopher.
Conti……
 After an individual philosopher finishes eating, they need to put
down both forks so that the forks become available to others.
 A philosopher can take the fork on their right or the one on their
left as they become available, but cannot start eating before
getting both forks.
 Eating is not limited by the remaining amounts of spaghetti or
stomach space; an infinite supply and an infinite demand are
assumed.
Conti….
 The problem is how to design a discipline of behavior such that no
philosopher will starve
 i.e.
• each can forever continue to alternate between eating and thinking,
assuming that no philosopher can know when others may want to eat
or think
Problem
 The problem was designed to illustrate the challenges of avoiding
deadlock, a system state in which no progress is possible.
 To see that a proper solution to this problem is not obvious,
consider a proposal in which each philosopher is instructed to
behave as follows:
• think until the left fork is available; when it is, pick it up;
• think until the right fork is available; when it is, pick it up;
• when both forks are held, eat for a fixed amount of time;
• then, put the right fork down;
• then, put the left fork down;
• repeat from the beginning.
Conti…..
 This attempted solution fails because it allows the system to
reach a deadlock state, in which no progress is possible.
 This is a state in which each philosopher has picked up the fork to
the left, and is waiting for the fork to the right to become
available, vice versa.
 With the given instructions, this state can be reached, and when
it is reached, the philosophers will eternally wait for each other
to release a fork.
Thank You

More Related Content

What's hot

Priority scheduling algorithms
Priority scheduling algorithmsPriority scheduling algorithms
Priority scheduling algorithms
Daffodil International University
 
DPP
DPPDPP
Classical problem of synchronization
Classical problem of synchronizationClassical problem of synchronization
Classical problem of synchronization
Shakshi Ranawat
 
INTER PROCESS COMMUNICATION (IPC).pptx
INTER PROCESS COMMUNICATION (IPC).pptxINTER PROCESS COMMUNICATION (IPC).pptx
INTER PROCESS COMMUNICATION (IPC).pptx
LECO9
 
Semophores and it's types
Semophores and it's typesSemophores and it's types
Semophores and it's types
Nishant Joshi
 
OS Process Synchronization, semaphore and Monitors
OS Process Synchronization, semaphore and MonitorsOS Process Synchronization, semaphore and Monitors
OS Process Synchronization, semaphore and Monitors
sgpraju
 
Process synchronization in Operating Systems
Process synchronization in Operating SystemsProcess synchronization in Operating Systems
Process synchronization in Operating Systems
Ritu Ranjan Shrivastwa
 
Operating System Process Synchronization
Operating System Process SynchronizationOperating System Process Synchronization
Operating System Process Synchronization
Haziq Naeem
 
CPU Scheduling Algorithms
CPU Scheduling AlgorithmsCPU Scheduling Algorithms
CPU Scheduling Algorithms
Shubhashish Punj
 
Semaphores OS Basics
Semaphores OS BasicsSemaphores OS Basics
Semaphores OS Basics
Shijin Raj P
 
cpu scheduling
cpu schedulingcpu scheduling
cpu scheduling
hashim102
 
Producer consumer
Producer consumerProducer consumer
Producer consumer
Mohd Tousif
 
deadlock avoidance
deadlock avoidancedeadlock avoidance
deadlock avoidance
wahab13
 
Pipelining and vector processing
Pipelining and vector processingPipelining and vector processing
Pipelining and vector processing
Kamal Acharya
 
Parallel processing
Parallel processingParallel processing
Parallel processing
rajshreemuthiah
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
vampugani
 
Operating System: Deadlock
Operating System: DeadlockOperating System: Deadlock
Operating System: Deadlock
InteX Research Lab
 
SCHEDULING ALGORITHMS
SCHEDULING ALGORITHMSSCHEDULING ALGORITHMS
SCHEDULING ALGORITHMS
Margrat C R
 
Deadlock Avoidance - OS
Deadlock Avoidance - OSDeadlock Avoidance - OS
Deadlock Avoidance - OS
MsAnita2
 
Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]
Ravindra Raju Kolahalam
 

What's hot (20)

Priority scheduling algorithms
Priority scheduling algorithmsPriority scheduling algorithms
Priority scheduling algorithms
 
DPP
DPPDPP
DPP
 
Classical problem of synchronization
Classical problem of synchronizationClassical problem of synchronization
Classical problem of synchronization
 
INTER PROCESS COMMUNICATION (IPC).pptx
INTER PROCESS COMMUNICATION (IPC).pptxINTER PROCESS COMMUNICATION (IPC).pptx
INTER PROCESS COMMUNICATION (IPC).pptx
 
Semophores and it's types
Semophores and it's typesSemophores and it's types
Semophores and it's types
 
OS Process Synchronization, semaphore and Monitors
OS Process Synchronization, semaphore and MonitorsOS Process Synchronization, semaphore and Monitors
OS Process Synchronization, semaphore and Monitors
 
Process synchronization in Operating Systems
Process synchronization in Operating SystemsProcess synchronization in Operating Systems
Process synchronization in Operating Systems
 
Operating System Process Synchronization
Operating System Process SynchronizationOperating System Process Synchronization
Operating System Process Synchronization
 
CPU Scheduling Algorithms
CPU Scheduling AlgorithmsCPU Scheduling Algorithms
CPU Scheduling Algorithms
 
Semaphores OS Basics
Semaphores OS BasicsSemaphores OS Basics
Semaphores OS Basics
 
cpu scheduling
cpu schedulingcpu scheduling
cpu scheduling
 
Producer consumer
Producer consumerProducer consumer
Producer consumer
 
deadlock avoidance
deadlock avoidancedeadlock avoidance
deadlock avoidance
 
Pipelining and vector processing
Pipelining and vector processingPipelining and vector processing
Pipelining and vector processing
 
Parallel processing
Parallel processingParallel processing
Parallel processing
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
 
Operating System: Deadlock
Operating System: DeadlockOperating System: Deadlock
Operating System: Deadlock
 
SCHEDULING ALGORITHMS
SCHEDULING ALGORITHMSSCHEDULING ALGORITHMS
SCHEDULING ALGORITHMS
 
Deadlock Avoidance - OS
Deadlock Avoidance - OSDeadlock Avoidance - OS
Deadlock Avoidance - OS
 
Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]
 

Similar to Dining Philosopher Problem

Zuhri ramadhan dining philosophers theory and concept in operating system
Zuhri ramadhan   dining philosophers theory and concept in operating systemZuhri ramadhan   dining philosophers theory and concept in operating system
Zuhri ramadhan dining philosophers theory and concept in operating system
Raj Kamal
 
Deadlock _Classic problems.pptx
Deadlock _Classic problems.pptxDeadlock _Classic problems.pptx
Deadlock _Classic problems.pptx
GopikaS12
 
Deadlock.ppt
Deadlock.pptDeadlock.ppt
Deadlock.ppt
AhmedKhairulAmin
 
2 2 food webs ms.ls2
2 2 food webs  ms.ls22 2 food webs  ms.ls2
2 2 food webs ms.ls2
James Wampler
 
biology power pppppppppppppppppppppppppt
biology power ppppppppppppppppppppppppptbiology power pppppppppppppppppppppppppt
biology power pppppppppppppppppppppppppt
Dhugasa
 
12 deadlock concept
12 deadlock concept12 deadlock concept
12 deadlock concept
DeepaMaria10489
 
Open-endedness curriculum at EEM Institute
Open-endedness curriculum at EEM InstituteOpen-endedness curriculum at EEM Institute
Open-endedness curriculum at EEM Institute
Anatoly Levenchuk
 
1 30 changes in biological systems and last test review ii ms.ls2
1 30 changes in biological systems and last test review ii  ms.ls21 30 changes in biological systems and last test review ii  ms.ls2
1 30 changes in biological systems and last test review ii ms.ls2
James Wampler
 
1 30 changes in biological systems and last test review ms.ls2
1 30 changes in biological systems and last test review  ms.ls21 30 changes in biological systems and last test review  ms.ls2
1 30 changes in biological systems and last test review ms.ls2
James Wampler
 
Scientific study of life
Scientific study of lifeScientific study of life
Scientific study of life
C Ebeling
 
Unit Plan on Cells
Unit Plan on CellsUnit Plan on Cells
Unit Plan on Cells
Michael Robbins
 
Complexadaptivesystemstheory 12613245196525-phpapp02
Complexadaptivesystemstheory 12613245196525-phpapp02Complexadaptivesystemstheory 12613245196525-phpapp02
Complexadaptivesystemstheory 12613245196525-phpapp02
Zenobia Beukes
 
Reasoning Requirements for Bioscience
Reasoning Requirements for BioscienceReasoning Requirements for Bioscience
Reasoning Requirements for Bioscience
Emanuele Della Valle
 
Tf77799400
Tf77799400Tf77799400
Tf77799400
AQSA SHAHID
 
Assignment 1BackgroundWhen you look around at the world, you .docx
Assignment 1BackgroundWhen you look around at the world, you .docxAssignment 1BackgroundWhen you look around at the world, you .docx
Assignment 1BackgroundWhen you look around at the world, you .docx
sherni1
 
Chapter07 Revised
Chapter07 RevisedChapter07 Revised
Chapter07 Revised
cmilliken
 
Unit compilation 1
Unit compilation 1Unit compilation 1
Unit compilation 1
christybaker2424
 
human_physiology.pdf
human_physiology.pdfhuman_physiology.pdf
human_physiology.pdf
MaruMengeshaWorku18B
 
Tu812 tma02 presentation_part_2 version 2 (forum post)
Tu812 tma02 presentation_part_2 version 2 (forum post)Tu812 tma02 presentation_part_2 version 2 (forum post)
Tu812 tma02 presentation_part_2 version 2 (forum post)
Jitse D. J. van Ameijde
 
Media Presentation Assignment - Neuroprosthetics
Media Presentation Assignment - NeuroprostheticsMedia Presentation Assignment - Neuroprosthetics
Media Presentation Assignment - Neuroprosthetics
CodydeVries
 

Similar to Dining Philosopher Problem (20)

Zuhri ramadhan dining philosophers theory and concept in operating system
Zuhri ramadhan   dining philosophers theory and concept in operating systemZuhri ramadhan   dining philosophers theory and concept in operating system
Zuhri ramadhan dining philosophers theory and concept in operating system
 
Deadlock _Classic problems.pptx
Deadlock _Classic problems.pptxDeadlock _Classic problems.pptx
Deadlock _Classic problems.pptx
 
Deadlock.ppt
Deadlock.pptDeadlock.ppt
Deadlock.ppt
 
2 2 food webs ms.ls2
2 2 food webs  ms.ls22 2 food webs  ms.ls2
2 2 food webs ms.ls2
 
biology power pppppppppppppppppppppppppt
biology power ppppppppppppppppppppppppptbiology power pppppppppppppppppppppppppt
biology power pppppppppppppppppppppppppt
 
12 deadlock concept
12 deadlock concept12 deadlock concept
12 deadlock concept
 
Open-endedness curriculum at EEM Institute
Open-endedness curriculum at EEM InstituteOpen-endedness curriculum at EEM Institute
Open-endedness curriculum at EEM Institute
 
1 30 changes in biological systems and last test review ii ms.ls2
1 30 changes in biological systems and last test review ii  ms.ls21 30 changes in biological systems and last test review ii  ms.ls2
1 30 changes in biological systems and last test review ii ms.ls2
 
1 30 changes in biological systems and last test review ms.ls2
1 30 changes in biological systems and last test review  ms.ls21 30 changes in biological systems and last test review  ms.ls2
1 30 changes in biological systems and last test review ms.ls2
 
Scientific study of life
Scientific study of lifeScientific study of life
Scientific study of life
 
Unit Plan on Cells
Unit Plan on CellsUnit Plan on Cells
Unit Plan on Cells
 
Complexadaptivesystemstheory 12613245196525-phpapp02
Complexadaptivesystemstheory 12613245196525-phpapp02Complexadaptivesystemstheory 12613245196525-phpapp02
Complexadaptivesystemstheory 12613245196525-phpapp02
 
Reasoning Requirements for Bioscience
Reasoning Requirements for BioscienceReasoning Requirements for Bioscience
Reasoning Requirements for Bioscience
 
Tf77799400
Tf77799400Tf77799400
Tf77799400
 
Assignment 1BackgroundWhen you look around at the world, you .docx
Assignment 1BackgroundWhen you look around at the world, you .docxAssignment 1BackgroundWhen you look around at the world, you .docx
Assignment 1BackgroundWhen you look around at the world, you .docx
 
Chapter07 Revised
Chapter07 RevisedChapter07 Revised
Chapter07 Revised
 
Unit compilation 1
Unit compilation 1Unit compilation 1
Unit compilation 1
 
human_physiology.pdf
human_physiology.pdfhuman_physiology.pdf
human_physiology.pdf
 
Tu812 tma02 presentation_part_2 version 2 (forum post)
Tu812 tma02 presentation_part_2 version 2 (forum post)Tu812 tma02 presentation_part_2 version 2 (forum post)
Tu812 tma02 presentation_part_2 version 2 (forum post)
 
Media Presentation Assignment - Neuroprosthetics
Media Presentation Assignment - NeuroprostheticsMedia Presentation Assignment - Neuroprosthetics
Media Presentation Assignment - Neuroprosthetics
 

Recently uploaded

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
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
zuzanka
 
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
zuzanka
 
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
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
iammrhaywood
 
Lifelines of National Economy chapter for Class 10 STUDY MATERIAL PDF
Lifelines of National Economy chapter for Class 10 STUDY MATERIAL PDFLifelines of National Economy chapter for Class 10 STUDY MATERIAL PDF
Lifelines of National Economy chapter for Class 10 STUDY MATERIAL PDF
Vivekanand Anglo Vedic Academy
 
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxBeyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
EduSkills OECD
 
Nutrition Inc FY 2024, 4 - Hour Training
Nutrition Inc FY 2024, 4 - Hour TrainingNutrition Inc FY 2024, 4 - Hour Training
Nutrition Inc FY 2024, 4 - Hour Training
melliereed
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
haiqairshad
 
Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
MysoreMuleSoftMeetup
 
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
 
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
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
siemaillard
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
GeorgeMilliken2
 
Standardized tool for Intelligence test.
Standardized tool for Intelligence test.Standardized tool for Intelligence test.
Standardized tool for Intelligence test.
deepaannamalai16
 
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
National Information Standards Organization (NISO)
 
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
 
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdfREASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
giancarloi8888
 
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
 

Recently uploaded (20)

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
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
 
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.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
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
 
Lifelines of National Economy chapter for Class 10 STUDY MATERIAL PDF
Lifelines of National Economy chapter for Class 10 STUDY MATERIAL PDFLifelines of National Economy chapter for Class 10 STUDY MATERIAL PDF
Lifelines of National Economy chapter for Class 10 STUDY MATERIAL PDF
 
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxBeyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
 
Nutrition Inc FY 2024, 4 - Hour Training
Nutrition Inc FY 2024, 4 - Hour TrainingNutrition Inc FY 2024, 4 - Hour Training
Nutrition Inc FY 2024, 4 - Hour Training
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
 
Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
 
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
 
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
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
 
Standardized tool for Intelligence test.
Standardized tool for Intelligence test.Standardized tool for Intelligence test.
Standardized tool for Intelligence test.
 
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
 
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
 
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdfREASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
 
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
 

Dining Philosopher Problem

  • 1. Operating System Presented By : Chirag Parmar(115333) Vijay Raval(115356) Dining Philosopher Problem Org. :Gujarat Vidyapith
  • 3. Introduction  The dining philosophers problem is an example problem often used in concurrent algorithm design to illustrate synchronization issues and techniques for resolving them.  It was originally formulated in 1965 by Edsger Dijkstra as a student exam exercise, presented in terms of computers competing for access to tape drive peripherals. Soon after, Tony Hoare gave the problem its present formulation.
  • 4. What is Concurrent ?  concurrency is the decomposability property of a program, algorithm, or problem into order-independent or partially ordered components or units  This means that even if the concurrent units of the program, algorithm, or problem are executed out-of-order or in partial order, the final outcome will remain the same.  This allows for parallel execution of the concurrent units, which can significantly improve overall speed of the execution in multi- processor and multi-core systems
  • 5. What is Synchronization ?  synchronization refers to one of two distinct but related concepts: 1. synchronization of processes 2. synchronization of data.  Process synchronization:  Process synchronization refers to the idea that multiple processes are to join up or handshake at a certain point, in order to reach an agreement or commit to a certain sequence of action.  Data synchronization :  Data synchronization refers to the idea of keeping multiple copies of a dataset in coherence with one another, or to maintain data integrity.
  • 6. What is DeadLock ?  Deadlock is a state in which each member of a group of actions, is waiting for some other member to release a lock.  Deadlock is a common problem in multiprocessing systems, parallel computing, and distributed systems, where software and hardware locks are used to handle shared resources and implement process synchronization.
  • 7. Problem Statement  Five silent philosophers sit at a round table with bowls of spaghetti. Forks are placed between each pair of adjacent philosophers  Each philosopher must alternately think and eat. However, a philosopher can only eat spaghetti when they have both left and right forks.  Each fork can be held by only one philosopher and so a philosopher can use the fork only if it is not being used by another philosopher.
  • 8. Conti……  After an individual philosopher finishes eating, they need to put down both forks so that the forks become available to others.  A philosopher can take the fork on their right or the one on their left as they become available, but cannot start eating before getting both forks.  Eating is not limited by the remaining amounts of spaghetti or stomach space; an infinite supply and an infinite demand are assumed.
  • 9. Conti….  The problem is how to design a discipline of behavior such that no philosopher will starve  i.e. • each can forever continue to alternate between eating and thinking, assuming that no philosopher can know when others may want to eat or think
  • 10. Problem  The problem was designed to illustrate the challenges of avoiding deadlock, a system state in which no progress is possible.  To see that a proper solution to this problem is not obvious, consider a proposal in which each philosopher is instructed to behave as follows: • think until the left fork is available; when it is, pick it up; • think until the right fork is available; when it is, pick it up; • when both forks are held, eat for a fixed amount of time; • then, put the right fork down; • then, put the left fork down; • repeat from the beginning.
  • 11. Conti…..  This attempted solution fails because it allows the system to reach a deadlock state, in which no progress is possible.  This is a state in which each philosopher has picked up the fork to the left, and is waiting for the fork to the right to become available, vice versa.  With the given instructions, this state can be reached, and when it is reached, the philosophers will eternally wait for each other to release a fork.