I figured out where I was being confused.  I knew how the __clone syscall
worked and all, but I never realized that the processes get listed in a
normal ps.  So my killall was distributing the signal all over the place.
Good to know :)

I guess sigmasking the threads to ignore the signals would cause it to
behave correctly should anyone try and kill threads.  But here's a good
question:

Can you make a thread ignore sig 9's?  I think it would be kinda bad if a
user could kill -9 a thread of a process, no?

Randy

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
[EMAIL PROTECTED]
Sent: Saturday, July 29, 2000 2:10 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: pthreads and signals question


There is a discussion of this in

info libc ->POSIX Threads->
* Threads and Signal Handling:: Why you should avoid mixing the two, and
                                  how to do it if you must.

You should read it before you drive yourself nuts.

libc.info* are part of libc AFAIK, you should have them in /usr/info or
/usr/local/info

if "info libc" doesn't work, try "info -f libc"

I much prefer pinfo to read info pages:

http://aptiva.caltech.edu/links/rpm/redhat-6.0/RPMS/i386/pinfo-0.5.9-1.i386.
rpm

On Sat, 29 Jul 2000, Randy Locklair wrote:

> All:
>
> I have a question about the glibc implementation of pthreads.  Maybe
> there's
> a better place for me to post this, off so please inform me off list :)
> Now
> I'm not saying that the implementation is wrong or anything, I am just
> asking questions.
>
> I have a process which has a signal handler for signals such as SIGTERM
and
> SIGINT.  When there are no pthreads created, the signal handler works
fine.
> If i send either signal, it catches them, and shuts itself down.
>
> If i start a pthread, and send a SIGINT, any thing that would return on
a
> signal (select, etc) falls through, but the signal handler is never
run.
> If
> i send a SIGTERM, the handler is called twice (it seems) and seg faults
> when
> the second one tries to exit (presumably the first one is already
trying to
> call exit and they do it at the same time...that's my guess anyway).
>
> Anyway, does anyone have any ideas?  I've never seen this on any other
OS.
> Maybe its because linux's impelmentation is more posix compliant than
> others
> hehe.. Maybe I have to set some signal masks on the thread?  Let me
know if
> you have any ideas, i'll keep tinkering..
>
> Randy
>
Lawson

| We apologize if this message has reached you in error.
| Save the Planet, Save the Trees! Advertise via E mail.




________________________________________________________________
YOU'RE PAYING TOO MUCH FOR THE INTERNET!
Juno now offers FREE Internet Access!
Try it today - there's no risk!  For your FREE software, visit:
http://dl.www.juno.com/get/tagj.

Reply via email to