Grokking Java Interview Questions
0% completed
Deadlock, Livelock, and Starvation
Threads that share locks can stop making progress in three ways:
- Waiting forever. Two threads each hold a lock that the other one needs. No exception is thrown and nothing is printed.
- Busy without a result. Two threads react to each other again and again, and neither of them completes its work.
- Served too rarely. One thread stays ready to run, and other threads keep getting the lock before it.
They are called deadlock, livelock, and starvation, in this order. Two questions are about the first one, its causes and its prevention
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%