Re: Regarding Signals in Kernel

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

 



Hi....

On Mon, Sep 13, 2010 at 01:22, Dave Hylands <dhylands@xxxxxxxxx> wrote:
> Hi Sri,
>
> On Sun, Sep 12, 2010 at 10:02 AM, Sri Ram Vemulpali
> <sri.ram.gmu06@xxxxxxxxx> wrote:
>> Hi Guys,
>>    This is the question asked by WindRiver.com in interview.
>>    Question: A process has 5 children. Process child 5 is trying to send
>> signal (some signal) to Child 2 and Child 3. Calls signal(2,SIG),
>> signal(3,SIG). Now the question is, How are the signals delivered, I mean
>> their order and which child process gets the signal first.
>
> It is my understanding that signals are delivered when a process makes
> the kernel-space to user-space transition (say on a system call). So
> which one will be called first depends on which child makes the next
> system call.

AFAIK, signal set on target task_struct can be modified anytime. Then,
on the next nearest context switch  (AFAIK: interrupt to kernel mode,
interrupt to user mode and so on) ...due to the raised re-scheduling
request most of times (I really become rusty here), next process is
picked.

If it is the one that has the signal queued, its signal set is checked
for any waiting signal. Depending the signal and the setup of handler,
it could be handled in kernel space right away before rising up to
user mode. Or it could be...I call it, "blitzkrieg mode", jump fast to
user mode, execute the user mode handler (in the case there's custom
handler installed), fall back again to kernel mode.

So as you can see briefly above, signal could be delivered anytime,
but you can't really tell when it would be picked. Nasty, yes...this
is a non real time OS anyway :D

>> I know that if you use real time signals they are delivered in order and
>> accounts for number of times signals are delivered, this is in threads. But
>> when it comes process, a process can not send signals to its own group in
>> linux kernel.
>> So can anyone please clarify this, what is the right scenario.
>
> I'm not familiar enough with the distinctions to provide any more detail here.
>
> I don't see any reason why a process can't signal itself, but this is
> just an opinion, not backed up by any fact or experiment.
>
> --
> Dave Hylands
> Shuswap, BC, Canada
> http://www.DaveHylands.com/
>
> --
> To unsubscribe from this list: send an email with
> "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
> Please read the FAQ at http://kernelnewbies.org/FAQ
>
>



-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ




[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