From mboxrd@z Thu Jan 1 00:00:00 1970 From: dhylands@gmail.com (Dave Hylands) Date: Tue, 13 Dec 2011 10:17:02 -0800 Subject: how can we wake up some process which is scheduled? In-Reply-To: References: Message-ID: To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org Hi loody, On Tue, Dec 13, 2011 at 12:44 AM, loody wrote: > hi all: > There is a kernel API, "schedule_timeout_interruptible". > since it has the name interruptible, who and how can we interrupt this > task? > suppose A use schedule_timeout_interruptible for 20s period and B > found something and he want to wake up A within this 20s period. > You send the task a signal. The API for doing this has a rather unfortunate name, and is called kill from user-space. >>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. 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. In kernel space, I would generally use something like a timed semaphore (down_timeout). -- Dave Hylands Shuswap, BC, Canada http://www.davehylands.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20111213/cf0edd32/attachment.html