chicken-users
[Top][All Lists]
Advanced

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

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


From: Felix Winkelmann
Subject: Re: [Chicken-users] a couple of questions about foreign functions (Modified by Valentyn Kamyshenko)
Date: Fri, 23 Jan 2004 08:27:39 +0100
User-agent: Opera7.21/Win32 M2 build 3218

Am Thu, 22 Jan 2004 01:51:38 -0800 hat Valentyn Kamyshenko <address@hidden> geschrieben:

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.

That's understandable, but IMHO the whole idea of UNIX signals is something
that I consider somewhat broken. A signal handler can be called at any time,
completely out of context. This is not compatible with the execution model
that Chicken uses (unfortunately).

 Probably, a compiler option? Is it achievable at all?

You mean a mode where signals may trigger Scheme signal handlers, even
in a blocking I/O operation, right?

Hmmm... Generally it should be possible to perform an out-of-context
call inside a signal handler (comparable to the way callbacks are handled),
but IIRC there exist some restrictions on what system calls may be
invoked inside of a signal handler. So the signal handler should only
set some flag (indicating a pending signal) and then abort the I/O
operation in progress, which then should return to the caller and
let the usual interrupt-processing behaviour take place.

Is it possible in UNIX to abort a currently blocking I/O operation,
given a file-descriptor?


cheers,
felix




reply via email to

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