[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: Fri, 23 Jan 2004 17:14:18 -0800
User-agent: Gnus/5.1002 (Gnus v5.10.2) XEmacs/21.5 (celeriac, berkeley-unix)


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

    Felix> You mean a mode where signals may trigger Scheme signal
    Felix> handlers, even in a blocking I/O operation, right?
actually, if this is impossible, even the mode where Scheme does not
touch signal handling at all would be useful (so that I could write
signal handler in C when I need it - of course, there will be some
limitations in terms of what it could do - e.g., to use static/global
variables to interact with Scheme and do not use any chicken
functions - smth. like that).

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

    Felix> Is it possible in UNIX to abort a currently blocking I/O
    Felix> operation, given a file-descriptor?
No, I do not think so - with the exception of the signal itself.
All other possiilities seem to be excluded by POSIX (and other)



reply via email to

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