This is the mail archive of the glibc-linux@ricardo.ecn.wfu.edu mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RV: linux threads, the manager.




> -----Mensaje original-----
> De: Monserrat Seisdedos Nuñez 
> Enviado el: miércoles 31 de octubre de 2001 10:57
> Para: 'Kaz Kylheku'
> Asunto: RE: linux threads, the manager.
> 
> 
> 
> 
> > -----Mensaje original-----
> > De: Kaz Kylheku [mailto:kaz@ashi.footprints.net]
> > Enviado el: martes 30 de octubre de 2001 19:34
> > Para: 'Glibc-Linux (E-mail)
> > Asunto: Re: linux threads, the manager.
> > 
> > 
> > 
> > 
> > On Tue, 30 Oct 2001, Monserrat Seisdedos Nuñez wrote:
> > 
> > > i have a multithread process under Linux
> > > i expect every thread in the group to be terminated if i 
> > kill one of 
> > them.
> > 
> > However, that is just not how things work in Linux, so your
> > expectation won't be met.
> > 
> > Moreover, there isn't any UNIX or POSIX document which requires the
> > behavior that you expect.
> I thought POSIX did. or so it says in the FAQ'S of 
> LinuxThreads Library site
> http://pauillac.inria.fr/~xleroy/linuxthreads/faq.html
> 
> J.2: When I send a SIGKILL to a particular thread using 
> pthread_kill, all my threads are killed!
> That's how it should be. The POSIX standard mandates that all 
> threads should terminate when the process (i.e. the 
> collection of all threads running the program) receives a 
> signal whose effect is to terminate the process (such as 
> SIGKILL or SIGINT when no handler is installed on that 
> signal). This behavior makes a lot of sense: when you type 
> "ctrl-C" at the keyboard, or when a thread crashes on a 
> division by zero or a segmentation fault, you really want all 
> threads to stop immediately, not just the one that caused the 
> segmentation violation or that got the SIGINT signal. (This 
> assumes default behavior for those signals; see question J.3 
> if you install handlers for those signals.)
> If you're trying to terminate a thread without bringing the 
> whole process down, use pthread_cancel().
> 
> 
> 
> > 
> > >       PID             PPID            CMD
> > >       15744           15509           thr_kill
> > >       15745           15744           thr_kill
> > >       15746           15745           thr_kill
> > >       15747           15745           thr_kill
> > >       15748           15745           thr_kill
> > >
> > > If i kill 15745, i expect every threads to terminate but 
> > the result is:
> > 
> > On other systems, you can't even see threads as individual processes
> > with ps, so you aren't even supposed to be able to do this. It's a
> > feature of Linux that you can even see threads this way.
> > 
> > > Is any way to avoid it or maybe it is a bug??
> > 
> > If you stick a fork into a toaster, you might get hurt. That is
> > not a bug in the toaster.
> > 
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]