Re: [Ecls-list] Making an external signal handler play nice with embedded ECL

2011-02-28 Thread Juan Jose Garcia-Ripoll
What about the code below? It has not been tested and might not be the optimal way, but it fixes various problems: * ecl_disable/enable_interrupts do not nest properly and thus can only be used around very small pieces of code, typically foreign C functions. * for prolongued interrupts disabling,

Re: [Ecls-list] Making an external signal handler play nice with embedded ECL

2011-02-27 Thread Nils Bruin
On Sat, 26 Feb 2011, Juan Jose Garcia-Ripoll wrote: > In the window from the signal handler swap until ECL is booted, ECL will > simply discard all signals, because the signal queue is not installed and > ECL is not marked as booted. Or do you perform the swap every time that ECL > code is execute

Re: [Ecls-list] Making an external signal handler play nice with embedded ECL

2011-02-26 Thread Juan Jose Garcia-Ripoll
On Sat, Feb 26, 2011 at 3:34 AM, Nils Bruin wrote: > I did not quite understand the mprotect trick first but I think I do now. > Let me verify: > - If the ECL signal handler finds that the interrupted code is not "safe", > then the handler stores the signal information and marks "env" read-only.

Re: [Ecls-list] Making an external signal handler play nice with embedded ECL

2011-02-23 Thread Juan Jose Garcia-Ripoll
Just a short email to say that I noticed this message. It pops up a complicated question that has been addressed several times in the mailing list, with no actual contribution that provided a real solution. I would love to discuss this again and really clean up this mess with SIGINT and Ctrl-C, bu

[Ecls-list] Making an external signal handler play nice with embedded ECL

2011-02-22 Thread Nils Bruin
The ECL documentation contains some information about how to set up signal handling with embedded ECL, but from what I understand the options are 1. Disable signals while ECL code is running 2. Let ECL install its signal handlers (which, in multithreaded mode, means that ECL will run a thre