[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] a couple of questions about foreign functions (Modif

From: Valentyn Kamyshenko
Subject: Re: [Chicken-users] a couple of questions about foreign functions (Modified by Valentyn Kamyshenko)
Date: Thu, 22 Jan 2004 01:51:38 -0800


On Jan 22, 2004, at 1:42 AM, Felix Winkelmann wrote:

Am Thu, 22 Jan 2004 00:38:06 -0800 hat Valentyn Kamyshenko <address@hidden> geschrieben:
Do I understand correctly, that for proper signal handling (in unix) the main branch should explicitly pass control to the scheduler? That is, e.g., if I use a library that uses (blocking) select or accept, the signals will be queued until the select (or accept) returns?
Is there a workaround?

I'm not sure I understand completely. You mean that you have the situation that you are doing a blocking I/O operation in a library, but you want to
handle signals during that time, right?

Hm. Tricky. Signals will be registered ok, but (as you correctly point
out), until execution is resumed in compiled Scheme code, the signal
will not be handled by the user-defined signal handler. It is not
possible to execute the Scheme code exactly at the point when the OS
triggers the signal, so the only solution I currently see is to
block repeatedly with a timeout. Now when the blocking takes place
in an external library, this might not be possible. Does the
library provide some hook for interrupting and resuming the I/O
operation, or perhaps to specify a timeout?

you actually answered my question (and your understanding of the question was correct). The library I'm working with is OpenSSL. It has non-blocking API, but it is more tricky (in particular, because of the fact that 'read' operation may trigger the 'write' and vice-versa).
Thus, it s possible to do.
In general, IMHO, it is a serious problem. I personally would rather prefer to live without threads (and without functionality that requires them in chicken), but to have standard signal handling, use blocking I/O calls in foreign functions etc. Probably, a compiler option? Is it achievable at all?

Thank you again,



Chicken-users mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]