chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Safe interrupt handlers?


From: Kon Lovett
Subject: Re: [Chicken-users] Safe interrupt handlers?
Date: Mon, 26 Feb 2007 08:54:27 -0800

On Feb 26, 2007, at 8:02 AM, John Cowan wrote:

Tony Sidaway scripsit:

An interrupt handler written in Chicken Scheme probably can't do a lot
without knocking over a heap of dominoes.

Nevertheless, would a simple lambda that only changes a top level flag
variable be stable enough to be useful?  This is often all that posix
interrupt handlers written in C do anyway.

Yes.


The trouble is that Posix signal handlers have to return, and Chicken
procedures don't return. You are probably better off writing the handler and its associated flag in C, and then using define-foreign- variable to
get access to the flag from Scheme code.

Writing signal handlers in Chicken Scheme works fine. I use the posix unit signal handler API in the testbase egg for resource limit violation catching. (testbase-posix-rlimit.scm)


--
Ambassador Trentino: I've said enough. I'm a man of few words.
Rufus T. Firefly: I'm a man of one word: scram!
        --Duck Soup                     John Cowan <address@hidden>


_______________________________________________
Chicken-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/chicken-users





reply via email to

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