Re: how to add signal handler to kernel thread?

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

 



I am actually trying to write a sort of interface to thread creation,
deletion and etc., which can be used in our development. The idea is to
provide abstraction for the rest of the developers. The library basically
should provide methods like create, destroy, suspend, resume, join and the
thinks. The whole idea of writing another simple library is to use it
completely in kernel context - which is why i'm not using pthread library.

My doubt arose because my original idea was to setup a signal handler sort
of so that I could do cleanup and kill the respective thread when a signal
arises.

By the way, it would be really great if you could let me know, how in Linux
the asynchronous way of signalling is done between the TCP/IP protocol suite
layers i.e., between ethernet, IP and TCP. Whenever ethernet driver sees a
packet, it will create a global memory structure which will be passed all
along. But how does it signal the IP layer about this packet. All I know,
vaguely is that packet is kept in the queues. But what happens when the same
function needs to be called for multiple packets i.e., processing multiple
packets asynchronously.


----- Original Message -----
From: "Jan Hudec" <bulb@ucw.cz>
To: "venugopal panchamukhi" <p_venu@delhi.tcs.co.in>
Sent: Friday, May 31, 2002 11:25 AM
Subject: Re: how to add signal handler to kernel thread?


> On Fri, May 31, 2002 at 11:20:40AM +0100, venugopal panchamukhi wrote:
> > This is another follow up to your answer to my question.
> > In _syscallN(arguments), it will call interrupt 0x80 to call the
> > _system_call which will finally call the actual code that needs to be
> > executed.
> > Can it be done in a way to directly call 0x80 interrupt by passing the
> > sigaction argument it requires. In this way, the user to kernel context
> > switching can be overcome, and a signal handler can also be added.
> > Is this a good idea???
>
> No, that's a mad idea. It involves arch specific asm code, wastes
> precious CPU time and gains nothing. Only place where kernel calls
> things through a syscall gate is the kernel_thread function, because it
> reduces code duplication there.
>
> Please tell what are you trying to do. I'm pretty sure there is an
> easier way to do it than this.
>
> --------------------------------------------------------------------------
------
>                   - Jan Hudec `Bulb' <bulb@ucw.cz>
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           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