From: Eric Wong Date: 2012-05-22T10:52:24+09:00 Subject: Re: [C ext and GVL] Why UBF() is called even if Ruby traps signals ?? Jos Backus wrote: > On Mon, May 21, 2012 at 4:47 PM, Eric Wong wrote: > > With the self-pipe trick, your ubf() will probably just be: > > > Or use pselect(2). Not sure how portable that is though. I単aki's using libuv/uv_run() as a wrapper to avoid using epoll/poll/kqueue/select/etc.. directly, so I don't think pselect() would work for him. Normally, regular select() will just stop with EINTR and that's all Ruby needs to reacquire the GVL. IO.select internally retries on EINTR, but only after running signal handlers and processing Thread#raise/#kill requests.