From: "Iñaki Baz Castillo" Date: 2012-05-30T03:37:07+09:00 Subject: Re: [C exten] Is it possible to avoid longjmp in exceptions, Thread#kill, exit(), signals? Please forget this for now. I've realized that my call to rb_protect() didn't rescue exceptions if they were not StandardError (due to a check I did in my C code). So I *do* can rescue at C level any kind of error/exception, inclouding Interrupt or Exit and act according. So please let me work a bit on it and I will comment the result. Thanks a lot. 2012/5/29 Iñaki Baz Castillo : > Hi, my Ruby C extension runs a C loop (libuv) without GVL. At some > point if an exception, Thread#kill, exit or a non trapped signal > occurs, Ruby executes longjmp and leaves my C loop in an inconsisten > status (i.e. while it was executing an internal libvu C iteration or > whatever). > > My Ruby code does an "ensure" and so, but in some corner cases I > cannot reuse the existing C loop, nor I can free its resources at C > level. > > My question is: is there any way to avoid the longjmp? or a different > approach: is there any way from my C code to avoid being interrupted > while I go to Ruby land (by acquiring the GVL)? > > Thanks a lot. > > -- > Iñaki Baz Castillo > -- Iñaki Baz Castillo