Re: how can we wake up some process which is scheduled?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi loody,

On Tue, Dec 13, 2011 at 12:44 AM, loody <miloody@xxxxxxxxx> 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
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux