Fwd: Signal delivery

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

 



Sorry missed to cc to newbies list.

---------- Forwarded message ----------
From: Unix learner <unix.kernellearn@xxxxxxxxx >
Date: May 4, 2007 9:43 AM
Subject: Re: Signal delivery
To: Mulyadi Santosa <mulyadi.santosa@xxxxxxxxx>

Hi Mulyadi,
     Thanks for your response.
I am still unclear about the signal handling mechanism of a kernel thread. Assuming I manually unblock a particular signal, and also register a particular handler too with it. Now my doubt is at what time this particular signal be handled, provided a) another kernel thread raise the signal for former thread, b) some user process(if it can) raise the signal.
The doubt came in my mind, because kernel thread will never go to user space, hence it should be checking for the pending signals at some other time, question is when ?? Is it every time it gets scheduled ? or ???

Thanks.



On 5/4/07, Mulyadi Santosa < mulyadi.santosa@xxxxxxxxx> wrote:
Hi
>     Need to clarify some concepts about signaling mechanism in linux
> kernel
> 2.4 and 2.6 ?
>
> What time the signal to a process is really delivered --
> 1. After moving from kernel space to user space - yes
personal comment: yes, if it returns to the target process that received
the signal. Just to be precise. And I think what you really mean here is
actually "handled", because signal is actually queued right at the time
other process send a signal to it.

> 2. After the process in kernel space wakes up from
> interruptible/uninterruptible sleep -- ??

Ok, do you mean "handled"? As far as I can tell by looking from the
code, unless you manually check the sigpending flag, returning to kernel
space after a sleep won't make a signal handler executed.
> 3. Can a kernel thread be signaled ? What time does it check for its
> pending
> signals ?
I forgot the detail, but yes basically you can do that. Of course, it
doesn't check by default. it is you that must check the sigpending
manually. Usually, all the kernel threads block all the signal (IIRC
from kthread_create() ) so you must manually unblock the spesific signal
number.
> 4. Can a user process signal a kernel thread (visible through ps), or
> only
> another kernel process can do that ? How is it implemented ?

See above.

regards,

Mulyadi



[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