March 22, 2015
11:14 p.m.
Thank you for the example. I understand what are the scheduling mechanics depending on task->state. But suppose another situation. Let's say I change current state to TASK_INTERRUPTIBLE. If I start now some long operation, then shouldn't the scheduler kick in as soon as he can and put my thread asleep? Or should I call necessarily schedule()? And if so, why?