Recognize that a deadlock occurs when each member is stuck waiting for another member to take action and that the properties of liveness require a system to make progress. Explore the classic dining philosophers scenario in which multiple threads are stuck in deadlock, waiting for other threads to release shared locks.
- Olivia and I decided to take a snack break … to demonstrate some of the problems that can occur … when using locks. … A classic example that's used to illustrate … synchronization issues when multiple threads … are competing for multiple locks … is the dining philosopher's problem. … In this scenario, Olivia and I are two philosophers … or threads doing what philosophers do best, … thinking and eating. … We both need to access a shared resource, this plate … of sushi, and each time one of us takes a piece of sushi, … we're modifying its value, the number of pieces … that are left. … The act of taking sushi from the plate … is a critical section. … So to protect it we've devised a mutual exclusion process … using these two chopsticks at mutexes. … When I want to take a bite of sushi, I'll first … pick up the chopstick closest to me to acquire a lock on it. … Then I pick up the farther chopstick. … Now I have possession of both locks. … I'm in the critical section. … So I'll take a piece of sushi. …
- Parallel computing architectures
- Shared vs. distributed memory
- Thread vs. process
- Execution scheduling
- The thread lifecycle in C++
- Mutual exclusion
- Locking in recursive and shared mutexes
- Acquiring a lock on a mutex with a try lock
- Resolving deadlock and livelock conditions
Skill Level Advanced
1. Parallel Computing Hardware
2. Threads and Processes
3. Mutual Exclusion
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.