Forum: Ruby Signal handling problem in ruby

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
9aafe2636a115bbdc137c93445054f22?d=identicon&s=25 Nasir Khan (Guest)
on 2007-06-24 04:33
(Received via mailing list)

I presume I am running into similar problem but this time with ruby
1.8.6(2007-03-13 patchlevel 0) [i386-mswin32] (under windows).
Basically my program runs and spawns several threads, some of which
block on
network IO but the main thread after doing all initialization etc
installs a
signal handler   by trap("INT") { s.stop }  where stop() is a method
call to
stop processing.

The ^c signal is not delivered to the program until I send a network
(unblocks the different thread waiting for IO).

Is this issue seen by others on 1.8.6? Any pointers are appreciated.

- nasir
Ee469623eb1b8e6e35d192822b9c4aa2?d=identicon&s=25 Florian Aßmann (Guest)
on 2007-06-24 17:48
(Received via mailing list)
Hi Nasir,

Make sure you trap the signal in the thread you put your main sleep,
otherwise maybe the thread finishes and the trap goes nirvana...

This topic is locked and can not be replied to.