In this video, learn about how if a mutex is already locked by another thread, rather than waiting for it to become available it can beneficial to do other work. Gain an understanding of how the try lock method can be used to acquire the lock on a mutex in a non-blocking manner.
- When multiple threads each have multiple tasks … to perform, making those threads block … and wait every time they attempt to acquire a lock that's … already taken may not be necessary or efficient. … Olivia and I are two threads doing several different tasks. … My thread will be taking an inventory of the fridge … to see what things we're running low on … and then add those to the shopping list … on our shared notepad. … I'll go back and forth between those two tasks. … - [Olivia] And my thread is searching … through the newspaper for grocery coupons … and then adding those items to the shared shopping list. … Ooh, there are some good deals this week! … Now that I've found some items … that I want, I'll take the pencil, … which is our mutex, to lock access … to the shared notepad so I can add them. … - I saw we're low on milk. … So now I'll go to acquire the pencil. … And I see Olivia has it. … If I attempt to lock a mutex in a regular blocking fashion, … my thread would enter a waiting state …
- 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.