From: Emil Ong Date: 2001-07-06T05:11:28+09:00 Subject: [ruby-talk:17346] Re: SIGUSR1/2 ? Hi, On Fri, 6 Jul 2001, Wesley James Landaker wrote: > Here what you can do: > > Initialize the library you're using. > > Install a dummy signal handler that does nothing, but SAVE the function > pointer that returns from the signal() function. That is the OLD signal > handler. > > Run ruby_init(); > > Reinstall the signal handler that you saved from the return of the signal() > call when you installed your dummy handler. First, I'd like to say that this is a brilliant solution and I really like it. Unfortunately, I'm still running into a problem. You see, I writing a parallel program and I'm running into a race condition. Sometimes, some of the programs are sending SIGUSR1 to each other between the time when Ruby sets its handler and when I restore the other library's handler (!). I can solve this by using some synchronization, but this of course slows things down. I'm happy with it now, but I could be happier if Ruby never set the signal handlers in the first place. Anyway, thanks for the awesome tip! Emil