chicken-users
[Top][All Lists]
Advanced

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

[Chicken-users] Signal woes.


From: Robin Lee Powell
Subject: [Chicken-users] Signal woes.
Date: Fri, 20 Jul 2007 18:54:29 -0700
User-agent: Mutt/1.5.13 (2006-08-11)

I have an app that uses a couple of C libraries.  The general
problem I'm trying to solve is providing status updates to the user
in a timely fashion (ideally, about 750ms).

I've tried two approaches, both of which have failed:

1.  set-signal-handler!.  This just doesn't work at all, because my
program spends most of its time in one of the C libraries running
wgetch (the ncurses call), which apparently counts as I/O, which
apparently stops Chicken from servicing the interrupt.  It simply
doesn't get serviced until I interact with the program.  Also, it
can't go sub-second times.

2.  A grotesque hack using foreign code and setitimer and such.  You
can find this hack at http://paste.lisp.org/display/44881.  The
problem here is that if the interrupt kicks off when the program is
busy, the whole program hangs with 100% CPU usage.  I suspect, but
cannot confirm, that this only happens when the code is in one of
the C libraries at the time.  Wrapping busy bits of the code in
(set-signal-handler! signal/alrm #f) / (set-signal-handler!
signal/alrm actual-call) seems to "solve" the problem, but that's an
unfortunate solution at best.

Suggestions for how to handle this would be greatly appreciated.

-Robin

-- 
http://www.digitalkingdom.org/~rlpowell/ *** http://www.lojban.org/
Reason #237 To Learn Lojban: "Homonyms: Their Grate!"
Proud Supporter of the Singularity Institute - http://singinst.org/




reply via email to

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