@bascule if trap can't mutex, and jruby can't fork... how would this work?
@drawohara confirm, use a pipe to send a message from a signal handler to a thread which runs hooks for each signal one-by-one
-
-
@bascule clever. how do you avoid having an intra-process pipe close war on the r/w ends? -
@drawohara well, ideally, you'd never close either end of the pipe... -
@bascule you have to to avoid deadlock... but with socket pair it works.... like this? https://gist.github.com/ahoward/5447859 -
@drawohara what's wrong with a pipe? -
@bascule because, with a pipe, you can use the w end until the r is closed, or vise versa, and we need both open intra process - no? -
@drawohara IMO you shouldn't ever close either end -
@bascule if you don't close the w end the entire process will block on r.puts(buf) tho !?!? -
@drawohara it will only block the main thread, and that's until the "signal callback runner" thread consumes the event
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.