Page 1 of 1

About Question enthuware.ocpjp.v8.2.1125 :

Posted: Sun Dec 08, 2019 6:16 am
by philcave
Starvation occurs when a single thread is perpetually denied access to a shared resource or lock.

Livelock occurs when two or more threads are conceptually blocked forever, although they are still active and trying to complete their task.

But the questions says "you observe that the lower priority threads rarely get a chance to run".

Doesn't this make the answer Livelock, since there are several threads unable to run, rather than being Starvation which relates to a single thread?

Re: About Question enthuware.ocpjp.v8.2.1125 :

Posted: Sun Dec 08, 2019 11:41 am
by admin
No, the answer is correct. All of the three situations i.e. starvation, livelock, and deadlock involve multiple threads. In starvation, a single thread (out of multiple) is starved. In a livelock, multiple threads get to run again and again but none of them is able to complete their job for lack of one resource or the other.