From: Ian Leitch Date: 2007-09-07T18:10:02+09:00 Subject: Trapped signals killing my subprocesses ------=_Part_49130_4617957.1189156200602 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hey list, I have a problem with trapping signals in the main thread whilst a subprocess is running in another thread. The signal is properly trapped, however it doesn't seem to stop the signal from being sent to the subprocess. Is this an inherent side effect of green thread implementations? Can anyone suggest a workaround? The code here demonstrates my problem. Run it, and hit ^C. My expectation was not to see 'killed :(' until the 10 seconds are up. #!/usr/bin/ruby class Sleeper < Thread def initialize super do IO.popen('sleep 10') {|f| puts f.gets } puts "killed :(" end end end Signal.trap('INT') { puts "Signal trapped." } a = Sleeper.new a.join Cheers Ian ------=_Part_49130_4617957.1189156200602--