chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Signal woes.


From: Robin Lee Powell
Subject: Re: [Chicken-users] Signal woes.
Date: Sun, 22 Jul 2007 13:24:36 -0700
User-agent: Mutt/1.5.13 (2006-08-11)

On Sun, Jul 22, 2007 at 03:54:26PM +0200, Thomas Christian Chust wrote:
> felix winkelmann wrote:
> 
> > On 7/21/07, Robin Lee Powell <address@hidden> wrote:
> >
> >> 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 can't think of anything besides running a second
> > (native) thread, if you're into that sort of thing... Or
> > splitting the application into multiple processes (say, one for
> > UI/status display and one for the guts). [...]
> 
> Hello,
> 
> I've never done serious development with curses so far, 

That's part of the issue here: I'm not using curses, I'm using CDK,
which is a widget library over curses with its own main loop and so
on.

> but shouldn't it be possible to run a select system call on the
> descriptor representing the terminal device and to provide a
> timeout for that call?
> 
> If you set up a loop that
> 
>  * selects the terminal device for input with a timeout
>  * checks upon return from select whether the timeout expired or
>    the terminal is ready for input
>  * calls wgetch if the terminal is ready for input OR
>  * updates the status display if the timeout expired

I could do that, but I'd have to hack CDK to do it, and I'm not at
all certain how to find out what terminal device wgetch is waiting
on in the first place.  I may end up hacking CDK anyways, though, so
I might go that route.

> Unfortunately, CHICKEN apparently doesn't support subsecond
> resolution for file-select.

But it does support 0 wait, and sub-second sleep times.  :D

-Robin




reply via email to

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