Previous | Next --- Slide 19 of 30
Back to Lecture Thumbnails
cwswanso

I know we say that any one thread is allowed to starve, I'm just wondering if this is ever actually a problem in practice? Based on the later graphs, I don't think it would be, but I'm not sure

aaguilet

@cwswanso I think it may be an issue in systems where one thread is slower than the others, or perhaps in distributed systems. A very hypothetical case:

  • Let's say that we have two nodes; A and B, in a distributed system
  • Each node has two+ cores, and is running two+ threads concurrently
  • All the threads are trying to access a resource in node A (in a fashion similar to the following slides, where if something has changed, you try again)

Then the threads in node A would be able to get/modify the shared resource a lot faster than threads in node B (because of communication latency) which could cause threads in node B to starve if there's no machanism to implement any order/fairness

cardiff

Why is it only that any one thread is allowed to starve? Why is the case with all threads starving except one that makes progress not allowed by this definition?

bxb

@cardiff I think you may be misunderstanding the wording (or I may be misunderstanding you). This definition says that at least one thread is guaranteed to make progress. And thus, this means every other thread might possibly be starved.

drayson

@cardiff What this is saying is that there exists at least one thread that will make progress, but that this is not necessarily any particular thread. Therefore, any given thread might be starved, although all threads will never simultaneously be starved.

cardiff

Oh, so based on these responses, I would interpret the line as follows: There must be at least one thread allowed to make progress at any given time, but it doesn't have to consistently be the same thread. Thus, if you pick one thread to examine, no matter which one you pick, it could be allowed to starve at some point by this definition.

drayson

@cardiff Yep, sounds correct!