Environment - embedded device with linux kernel 2.6.18 Requirements - 3 threads (created from one process, lets say P1 created T1, T2, T3)
T1 is at linux priority 99 (The highest), T2 is at linux priority 50 (The mid), T3 is at linux priority 2 (the lowest). No nice values is set explicitly for any of the threads.
Both T1, and T3 increments a variable once per second. T1 prints both variables once per 5 seconds. This goes smooth. [Problematic place] When T2 enters into an infinite loop "for(;;);", there after T1's count is increasing properly, but T3's count is not at all increasing. Meaning which T3 has never got time to run in CPU.
All this time I was thinking CFS of linux guarantees all priorities will get its appropriate share (based on weightage). But this proves that any thread which goes to hog CPU without sleeping, stopping all other lower priority threads from running.
Plz answer if anyone knows why CFS scheduler behaves in this way and if there is a way to correct this?