Re: [Python-Dev] Re: [Python-checkins] python/dist/src/Lib/test test_signal.py,1.9,1.10
Guido van Rossum <guido@python.org> writes:
Well, I'm not mixing threads and signals, really. I've now learnt that when a signal is directed at a process on BSD it is delivered to "a" signal from the set of signals that hasn't blocked it. ^^^^^^ ^^^^^^^
You mean theads, right?
thReads, yes :)
What I need to know, and can't quite work out, is how many threads are present when you just execute
$ ./python
and are sitting at the interpreter prompt? Is it just the one (the main thread)? That's what I thought, but I'm unable to explain the behaviour I'm seeing if that is indeed the case.
Python doesn't create any threads. On Linux, I know that when you start your first thread, the thread library creates an extra thread for some internal reasons. Who knows what BSD does though.
I'm not sure either, but I have convinced myself that signal mask handling is just buggered on BSD when the program is compiled in a multi-threaded style (as, in simple C programs don't do what you (well, I) would expect). Note this isn't about actually using threads -- just using "cc -pthreads". Now what do I do? Back my patch out? Not expose the functions on BSD? It works on Linux... Cheers, M. -- ARTHUR: Why should he want to know where his towel is? FORD: Everybody should know where his towel is. ARTHUR: I think your head's come undone. -- The Hitch-Hikers Guide to the Galaxy, Episode 7
I'm not sure either, but I have convinced myself that signal mask handling is just buggered on BSD when the program is compiled in a multi-threaded style (as, in simple C programs don't do what you (well, I) would expect). Note this isn't about actually using threads -- just using "cc -pthreads".
Now what do I do? Back my patch out? Not expose the functions on BSD? It works on Linux...
Add a configure check for the desired behavior and enable the changes only when the system behaves correctly. --Guido van Rossum (home page: http://www.python.org/~guido/)
On 30 May 2002, Michael Hudson wrote:
Python doesn't create any threads. On Linux, I know that when you start your first thread, the thread library creates an extra thread for some internal reasons. Who knows what BSD does though.
I'm not sure either, but I have convinced myself that signal mask handling is just buggered on BSD when the program is compiled in a multi-threaded style (as, in simple C programs don't do what you (well, I) would expect). Note this isn't about actually using threads -- just using "cc -pthreads".
Now what do I do? Back my patch out? Not expose the functions on BSD? It works on Linux...
Cheers, M.
Can you forward me your simple C test case and a description of what you expect and what you get? I can take the issue up on the FreeBSD lists and see if I can get any clarifications. If I don't get anything back, then I guess we'll have to try not exposing the extra stuff on FreeBSD at least. Have you been able to test on Solaris or NetBSD/OpenBSD? (I'm assuming these are available in the SF compile farm). -- Andrew I MacIntyre "These thoughts are mine alone..." E-mail: andymac@bullseye.apana.org.au | Snail: PO Box 370 andymac@pcug.org.au | Belconnen ACT 2616 Web: http://www.andymac.org/ | Australia
participants (3)
-
Andrew MacIntyre
-
Guido van Rossum
-
Michael Hudson