Hi loody,<br><br><div class="gmail_quote">On Tue, Dec 13, 2011 at 12:44 AM, loody <span dir="ltr"><<a href="mailto:miloody@gmail.com">miloody@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
hi all:<br>
There is a kernel API, "schedule_timeout_interruptible".<br>
since it has the name interruptible, who and how can we interrupt this task?<br>
suppose A use schedule_timeout_interruptible for 20s period and B<br>
found something and he want to wake up A within this 20s period.<br></blockquote><div><br>You send the task a signal. The API for doing this has a rather unfortunate name, and is called kill from user-space.<br><br>From kernel space, you can use kill_pid_info, or kill_proc_info. kill_pid_info is what's called to send SIGALARM when an itimer expires.<br>
<br>Although using signals in kernel space is fairly rare, it's typically a user-space to kernel-space thing, not a kernel-space to kernel-space thing.<br><br>In kernel space, I would generally use something like a timed semaphore (down_timeout).<br>
<br>-- <br></div></div>Dave Hylands<br>Shuswap, BC, Canada<br><a href="http://www.davehylands.com" target="_blank">http://www.davehylands.com</a><br>