Machine-translated by Google. Questions are authored in English.
Top

Discussion

Consider what starvation means for a thread. Which statement is correct?

  • A.Starvation is a thread repeatedly acquiring and releasing a lock without doing work.
  • B.Starvation is a thread making no progress because others monopolise a resource.
  • C.Starvation is a thread making no progress because it is waiting for a lock nobody holds.
  • D.Starvation is two threads each waiting for a lock the other holds.

Answer: B

In starvation the system as a whole progresses but one thread keeps losing out, typically because greedy neighbours hold a shared lock most of the time. That is different from deadlock, where nothing progresses, and from livelock, where threads react to each other and stay busy achieving nothing.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.