From: vinc94@gmail.com (Vincenzo Scotti) Date: Mon, 23 Mar 2015 00:14:49 +0100 Subject: Kernel thread scheduling In-Reply-To: <508921156.2279151.1426919611846.JavaMail.yahoo@mail.yahoo.com> References: <20150320231955.GA5713@vinc94-desktop> <4E5779AD88B2F040B8A7E83ECF544D1A5C7240@SJCPEX01CL03.citrite.net> <508921156.2279151.1426919611846.JavaMail.yahoo@mail.yahoo.com> Message-ID: <20150322231449.GA3235@vinc94-desktop> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org 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?