lkml.org 
[lkml]   [2006]   [Mar]   [16]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateFri, 17 Mar 2006 00:31:10 +0200
From"Yitzchak Eidus" <>
Subjectputing task to TASK_INTERRUPTIBLE before adding it to an wait queue
the function worker_thread in kernel 2.6.15.6  first put the task to
TASK_INTERRUPTIBLE and only then add itself to an wait queue:
	set_current_state(TASK_INTERRUPTIBLE);
	while (!kthread_should_stop()) {
		add_wait_queue(&cwq->more_work, &wait);
....
my question is, what will happen if the timeslice for the
worker_thread will finished just before it add itself to the wait
queue?
wont it call schedule() that will find the task is in
TASK_INTERRUPTIBLE state and remove it from the runqueue? ( that what
schedule() should do no? )
and then how will the kernel be able to call to worker_thread ever if
it isnt in any list???
thanks for the comments!
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2006-03-16 23:34    [from the cache]
©2003-2008