[Linux]What is Thundering herd problem in Linux point of view ?


We studied about the forms of wait_event and wake_up macros in Linux device driver text book. These macros are used to sleep the process while waiting for an event and  wake up from the sleep state when even occurs .

So when a process calls wake_up on a wait queue, all processes waiting on that wait queue are made runnable.This is the correct behavior in many cases. But in some other cases, it is possible to know ahead of time that only one of the processes being awakened will succeed in obtaining the desired resource, and rest will simply have to sleep again. For going to sleep again, each one of the processes has to obtain  the processor , contend for the resource(and any governing locks), and explicitly go to sleep. If the number of processes in the wait queue is large ,  this steps will cause the thundering herd behavior to the system which create serious degradation in the performance of the system .  

Published by RNP

A person who likes learning new languages.

Leave a comment