Previous | Next --- Slide 13 of 66
Back to Lecture Thumbnails
yayoh

Starvation is sort of like somebody raising their hand in class and the professor continuing to talk/ignoring them. The lecture is making progress, but the confused student is stuck. oof.

bmo

In addition to @yayoh's comment, starvation is usually not permanent, so the professor will eventually get to that student. It's just that the student is being starved (less attention), compared to other students in class i.e. there are some other students who are getting more attention than this starved student.

pintos

What are some common examples of naive solutions to problems that end up in starvation? In other classes, we always learn about the situations that lead to deadlock, but we hardly discuss situations that lead to starvation and how to avoid them.

donquixote

At first, I was thinking that a workload imbalance among threads is an example of starvation for the thread that does little work / stays idle, but that's not quite true. Starvation is when a process/thread has work to do, but it's not making progress on that work because other processes/threads are using resources disproportionately more.

As a real-world example of starvation in a computer program, maybe a certain hardware processor is physically farther from main memory than another processor, so the latter processor is able to load from memory and perform computations multiple times while the far away processor is still trying to make one load. This might be a silly/unrealistic example, but I think the concept is realistic. As for solutions, it seems one should just be aware of the hardware resources at one's disposal and ensure that the code they write (or the computer architecture they are designing, if they are building a chip) makes it less likely to encounter starvation.

Please log in to leave a comment.