public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* General question about TASK_INTERRUPTIBLE and schedule_timeout()
@ 2011-08-31 12:48 sifram rajas
  2011-08-31 13:05 ` sifram rajas
  2011-09-01  2:09 ` Yong Zhang
  0 siblings, 2 replies; 8+ messages in thread
From: sifram rajas @ 2011-08-31 12:48 UTC (permalink / raw)
  To: linux-kernel

Hi,

I have a general question about the following 2 lines of code I see
all over the kernel:
1         set_current_state(TASK_INTERRUPTIBLE) ;
2         schedule_timeout(<some value>);

In the above code, if we encounter an interrupt after executing line
1, we will end up
call schedule() from the architecture specific code for CONFIG_PREEMPT
kernels, after
the interrupt handler has been invokled.

This will cause the current task to sleep interruptibly forever
instead of for a certain timeout interval.

Won't this defeat the purpose of the above code to schedule out or
sleep for a certain finite timeout ?
If yes, then what are the techniques to solve this problem ?


Thanks,
Sifram.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-09-02  8:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-31 12:48 General question about TASK_INTERRUPTIBLE and schedule_timeout() sifram rajas
2011-08-31 13:05 ` sifram rajas
2011-09-01  2:09 ` Yong Zhang
2011-09-02  6:18   ` Shan Hai
2011-09-02  7:06     ` Shan Hai
2011-09-02  7:31       ` kautuk.c @samsung.com
2011-09-02  7:44         ` kautuk.c @samsung.com
2011-09-02  8:08         ` Shan Hai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox