lkml.org 
[lkml]   [1999]   [Dec]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectsleep_on, wake_up question
I'm working on a module, in which my ioctl function fuction needs to
block, waiting for the hardware to do its work (in an ISR/bottom half).
Code looks like:
my_ioctl()
{
...
// prepare work for adapter, and interrupt it
interruptible_sleep_on(&wq);
...
}

adapter_isr()
{
// do some work
wake_up_interruptible(&wq);
...
}

It's possible that the PC will be interrupted (by anything) just prior to
the sleep_on call in my_ioctl, and eventually, the adapter may even
complete its work (and call wake_up) before the sleep_on function was even
reached. In a heavily loaded system, this possibility is more than
theoretical. In this case, it appears that the calling process may forever
hang in sleep_on. Help? Am I missing something here? Perhaps there should
be a signalling mechanism in wake_up, so that if necessary, sleep_on may
complete immediately? No such mechanism on kernel sources I browsed
(2.2.12).

Thanks,
-Mark

Mark Mokryn
mark@psl.technion.ac.il
Tel: 972-2-5702983


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:55    [W:0.050 / U:0.852 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site