On 2015-03-22 07:14 PM, Vincenzo Scotti wrote: > 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? > > > Greetings Vincenzo. I would recommend reading Chapters 3 and 4 of Linux Kernel Development by Robert Love as when I was learning the scheduler and process management for the kernel,I found these chapters to be very useful.Further more for user space you are correct to my knowledge schedule is called for internal tasks that are taking too long in kernel land or to reschedule to another task,not for user space based tasks are TASK_INTERRUPTIBLE works fine there. Hope this Helps, Nick _______________________________________________ > Kernelnewbies mailing list > Kernelnewbies@xxxxxxxxxxxxxxxxx > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies > _______________________________________________ Kernelnewbies mailing list Kernelnewbies@xxxxxxxxxxxxxxxxx http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies