SlideShare a Scribd company logo
1 of 15
Multithread program
Vu Hai Ninh
What is thread?
What is thread?
- A thread is a single sequential flow of control within a program.
- Thread does not have its own address space but uses the memory and
other resources of the process in which it executes.
- There may be several threads in one process
- The Java Virtual Machine (JVM) manages these and schedules them for
execution.
Advantage points
- better use of system resources
- parallelize tasks
- enhanced performance on multi-processor machines
Disadvantage points
- Difficulty of writing code, increased complexity
- Difficulty of debugging, result is sometimes unpredictable
- Difficulty of managing concurrency, synchronization of shared resources
(objects, data); "starvation": some threads may not be served with a bad
design.
- Difficulty of testing
Single Threaded & Multithreaded
- Single: have only one follow of codes
- Multi threads: have two or more follow of codes
Thread life cycle
Creating thread
- Thread class in the java.lang package allows you to create and manage
threads. Each thread is a separate instance of this class.
- A new thread can be created in two ways:
- 1. By extending a thread class
- 2. By implementing an interface Runnable or Callable
Problems
- Race condition
- Deadlock
- Resource starvation
Race condition
To avoid it
- Lock.
- Synchronized.
- Semaphore.
- Monitor.
Lock
Synchronize
Deadlock
Thank you!

More Related Content

What's hot

Multithreading in-java
Multithreading in-javaMultithreading in-java
Multithreading in-javaaalipalh
 
Java Thread Synchronization
Java Thread SynchronizationJava Thread Synchronization
Java Thread SynchronizationBenj Del Mundo
 
Java And Multithreading
Java And MultithreadingJava And Multithreading
Java And MultithreadingShraddha
 
Concurrency in java
Concurrency in javaConcurrency in java
Concurrency in javaAbhra Basak
 
Runnable interface.34
Runnable interface.34Runnable interface.34
Runnable interface.34myrajendra
 
Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in javaArafat Hossan
 
Multi-threaded Programming in JAVA
Multi-threaded Programming in JAVAMulti-threaded Programming in JAVA
Multi-threaded Programming in JAVAVikram Kalyani
 
Learning Java 3 – Threads and Synchronization
Learning Java 3 – Threads and SynchronizationLearning Java 3 – Threads and Synchronization
Learning Java 3 – Threads and Synchronizationcaswenson
 
Java Threads and Concurrency
Java Threads and ConcurrencyJava Threads and Concurrency
Java Threads and ConcurrencySunil OS
 
Multithreading
MultithreadingMultithreading
Multithreadingbackdoor
 
Java Multithreading
Java MultithreadingJava Multithreading
Java MultithreadingRajkattamuri
 

What's hot (19)

Thread
ThreadThread
Thread
 
Threads concept in java
Threads concept in javaThreads concept in java
Threads concept in java
 
Java Threads
Java ThreadsJava Threads
Java Threads
 
Java threads
Java threadsJava threads
Java threads
 
Multithreading in-java
Multithreading in-javaMultithreading in-java
Multithreading in-java
 
Java Thread Synchronization
Java Thread SynchronizationJava Thread Synchronization
Java Thread Synchronization
 
Java thread
Java threadJava thread
Java thread
 
Java And Multithreading
Java And MultithreadingJava And Multithreading
Java And Multithreading
 
javathreads
javathreadsjavathreads
javathreads
 
Concurrency in java
Concurrency in javaConcurrency in java
Concurrency in java
 
Thread model in java
Thread model in javaThread model in java
Thread model in java
 
Runnable interface.34
Runnable interface.34Runnable interface.34
Runnable interface.34
 
Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in java
 
Chap2 2 1
Chap2 2 1Chap2 2 1
Chap2 2 1
 
Multi-threaded Programming in JAVA
Multi-threaded Programming in JAVAMulti-threaded Programming in JAVA
Multi-threaded Programming in JAVA
 
Learning Java 3 – Threads and Synchronization
Learning Java 3 – Threads and SynchronizationLearning Java 3 – Threads and Synchronization
Learning Java 3 – Threads and Synchronization
 
Java Threads and Concurrency
Java Threads and ConcurrencyJava Threads and Concurrency
Java Threads and Concurrency
 
Multithreading
MultithreadingMultithreading
Multithreading
 
Java Multithreading
Java MultithreadingJava Multithreading
Java Multithreading
 

Viewers also liked

La foresta ti ha - Abstract e rassegna stampa
La foresta ti ha - Abstract e rassegna stampaLa foresta ti ha - Abstract e rassegna stampa
La foresta ti ha - Abstract e rassegna stampaLuis Devin
 
знай та виконуй пдр
 знай та виконуй пдр знай та виконуй пдр
знай та виконуй пдрLesia Snigko
 
Tema 6.- España. El Estado liberal. Arte
Tema 6.- España. El Estado liberal. ArteTema 6.- España. El Estado liberal. Arte
Tema 6.- España. El Estado liberal. ArteDepartamentoGH
 
Тверской край в XV веке
Тверской край в XV векеТверской край в XV веке
Тверской край в XV векеDROFA-VENTANA
 
NAPP workshop on assessment in higher education Apr 2016
NAPP workshop on assessment in higher education Apr 2016NAPP workshop on assessment in higher education Apr 2016
NAPP workshop on assessment in higher education Apr 2016Alan Cliff
 
Экскурсия по краеведению для учащихся 6–8-х классов. Пешеходная экскурсия «Пу...
Экскурсия по краеведению для учащихся 6–8-х классов. Пешеходная экскурсия «Пу...Экскурсия по краеведению для учащихся 6–8-х классов. Пешеходная экскурсия «Пу...
Экскурсия по краеведению для учащихся 6–8-х классов. Пешеходная экскурсия «Пу...DROFA-VENTANA
 
Peer assessment evaluation - first edit
Peer assessment evaluation - first editPeer assessment evaluation - first edit
Peer assessment evaluation - first editDawn Allen
 
Tunning sql query
Tunning sql queryTunning sql query
Tunning sql queryvuhaininh88
 
GnRH antagonist in Ovarian stimulation for IVF/ET, Prof. Usama M.Fouda
GnRH antagonist in Ovarian stimulation for   IVF/ET, Prof. Usama M.Fouda GnRH antagonist in Ovarian stimulation for   IVF/ET, Prof. Usama M.Fouda
GnRH antagonist in Ovarian stimulation for IVF/ET, Prof. Usama M.Fouda umfrfouda
 
Фантастика и романтика (А. Грин, А. Азимов, Д. Амонд) Проблемы, волнующие че...
Фантастика и романтика (А. Грин, А. Азимов, Д. Амонд)  Проблемы, волнующие че...Фантастика и романтика (А. Грин, А. Азимов, Д. Амонд)  Проблемы, волнующие че...
Фантастика и романтика (А. Грин, А. Азимов, Д. Амонд) Проблемы, волнующие че...Електронні книги Ранок
 

Viewers also liked (13)

La foresta ti ha - Abstract e rassegna stampa
La foresta ti ha - Abstract e rassegna stampaLa foresta ti ha - Abstract e rassegna stampa
La foresta ti ha - Abstract e rassegna stampa
 
знай та виконуй пдр
 знай та виконуй пдр знай та виконуй пдр
знай та виконуй пдр
 
Tema 6.- España. El Estado liberal. Arte
Tema 6.- España. El Estado liberal. ArteTema 6.- España. El Estado liberal. Arte
Tema 6.- España. El Estado liberal. Arte
 
Тверской край в XV веке
Тверской край в XV векеТверской край в XV веке
Тверской край в XV веке
 
NAPP workshop on assessment in higher education Apr 2016
NAPP workshop on assessment in higher education Apr 2016NAPP workshop on assessment in higher education Apr 2016
NAPP workshop on assessment in higher education Apr 2016
 
Экскурсия по краеведению для учащихся 6–8-х классов. Пешеходная экскурсия «Пу...
Экскурсия по краеведению для учащихся 6–8-х классов. Пешеходная экскурсия «Пу...Экскурсия по краеведению для учащихся 6–8-х классов. Пешеходная экскурсия «Пу...
Экскурсия по краеведению для учащихся 6–8-х классов. Пешеходная экскурсия «Пу...
 
Peer assessment evaluation - first edit
Peer assessment evaluation - first editPeer assessment evaluation - first edit
Peer assessment evaluation - first edit
 
Tunning sql query
Tunning sql queryTunning sql query
Tunning sql query
 
GnRH antagonist in Ovarian stimulation for IVF/ET, Prof. Usama M.Fouda
GnRH antagonist in Ovarian stimulation for   IVF/ET, Prof. Usama M.Fouda GnRH antagonist in Ovarian stimulation for   IVF/ET, Prof. Usama M.Fouda
GnRH antagonist in Ovarian stimulation for IVF/ET, Prof. Usama M.Fouda
 
Фантастика и романтика (А. Грин, А. Азимов, Д. Амонд) Проблемы, волнующие че...
Фантастика и романтика (А. Грин, А. Азимов, Д. Амонд)  Проблемы, волнующие че...Фантастика и романтика (А. Грин, А. Азимов, Д. Амонд)  Проблемы, волнующие че...
Фантастика и романтика (А. Грин, А. Азимов, Д. Амонд) Проблемы, волнующие че...
 
Sql Antipatterns Strike Back
Sql Antipatterns Strike BackSql Antipatterns Strike Back
Sql Antipatterns Strike Back
 
The "Rickers" Amendment
The "Rickers" AmendmentThe "Rickers" Amendment
The "Rickers" Amendment
 
Untitled presentation
Untitled presentationUntitled presentation
Untitled presentation
 

Similar to Multithread Program Overview

Similar to Multithread Program Overview (20)

Mulitthread
MulitthreadMulitthread
Mulitthread
 
Thread
ThreadThread
Thread
 
Threads ppt
Threads pptThreads ppt
Threads ppt
 
Multi threaded programming
Multi threaded programmingMulti threaded programming
Multi threaded programming
 
Thread
ThreadThread
Thread
 
Thread (Operating System)
Thread  (Operating System)Thread  (Operating System)
Thread (Operating System)
 
Preparing for java 9 modules upload
Preparing for java 9 modules uploadPreparing for java 9 modules upload
Preparing for java 9 modules upload
 
Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in java
 
Thread
ThreadThread
Thread
 
J threads-pdf
J threads-pdfJ threads-pdf
J threads-pdf
 
multithreadingppt.pptx
multithreadingppt.pptxmultithreadingppt.pptx
multithreadingppt.pptx
 
Slot02 concurrency1
Slot02 concurrency1Slot02 concurrency1
Slot02 concurrency1
 
threads-ppfldkgsh;reghuiregiuhrughet.pptx
threads-ppfldkgsh;reghuiregiuhrughet.pptxthreads-ppfldkgsh;reghuiregiuhrughet.pptx
threads-ppfldkgsh;reghuiregiuhrughet.pptx
 
Performance Tuning - Memory leaks, Thread deadlocks, JDK tools
Performance Tuning -  Memory leaks, Thread deadlocks, JDK toolsPerformance Tuning -  Memory leaks, Thread deadlocks, JDK tools
Performance Tuning - Memory leaks, Thread deadlocks, JDK tools
 
Threads.ppt
Threads.pptThreads.ppt
Threads.ppt
 
Lecture 3 threads
Lecture 3   threadsLecture 3   threads
Lecture 3 threads
 
Threads .ppt
Threads .pptThreads .ppt
Threads .ppt
 
Thread Dump Analysis
Thread Dump AnalysisThread Dump Analysis
Thread Dump Analysis
 
dos slide share.pptx
dos slide share.pptxdos slide share.pptx
dos slide share.pptx
 
Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)
 

Recently uploaded

Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 

Recently uploaded (20)

Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 

Multithread Program Overview

  • 3. What is thread? - A thread is a single sequential flow of control within a program. - Thread does not have its own address space but uses the memory and other resources of the process in which it executes. - There may be several threads in one process - The Java Virtual Machine (JVM) manages these and schedules them for execution.
  • 4. Advantage points - better use of system resources - parallelize tasks - enhanced performance on multi-processor machines
  • 5. Disadvantage points - Difficulty of writing code, increased complexity - Difficulty of debugging, result is sometimes unpredictable - Difficulty of managing concurrency, synchronization of shared resources (objects, data); "starvation": some threads may not be served with a bad design. - Difficulty of testing
  • 6. Single Threaded & Multithreaded - Single: have only one follow of codes - Multi threads: have two or more follow of codes
  • 8. Creating thread - Thread class in the java.lang package allows you to create and manage threads. Each thread is a separate instance of this class. - A new thread can be created in two ways: - 1. By extending a thread class - 2. By implementing an interface Runnable or Callable
  • 9. Problems - Race condition - Deadlock - Resource starvation
  • 11. To avoid it - Lock. - Synchronized. - Semaphore. - Monitor.
  • 12. Lock