In this video, learn how to 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 philosophers 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 as 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 vs. sequential computing
- Shared vs. distributed memory
- Execution scheduling
- Thread lifecycle
- Mutual exclusion
- Synchronized methods
- Checking for liveness
Skill Level Advanced
Java Essential Training: Objects and APIswith David Gassner2h 46m Intermediate
Java Essential Training: Syntax and Structurewith David Gassner3h 9m Intermediate
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.