By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,772 Members | 906 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,772 IT Pros & Developers. It's quick & easy.

Signals and threads again

P: n/a
Hi everyone,

First off, I know that this has been discussed before and I did a
search but could not find anything that helped my situation.

Here is the problem: I have a Python program that uses threads, forked
processes, and signals and I can't seem to understand where the signals
go.

When the program starts, it creates a thread, which spins in select
until and event is set. After the thread is spawned, the main thread
goes on to created several child processes (using os.fork and
os.execvp) and then it joins the spinning thread. The main thread sets
a signal handler for SIGINT (Ctrl-C) before it joins the spinning
thread.

The problem that I am experiencing is that when SIGINT is sent to the
program, it gets delivered to the child processes (the fork'ed ones)
but the main thread's signal handler is never invoked.

I know that Python masks signals in threads but they should be fine in
the main thread and that is where they should get delivered.

Any insight into this problem would be appreciated?

--
-- Mitko
Oct 13 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.