felix winkelmann wrote: > On 7/21/07, Robin Lee Powell <[EMAIL PROTECTED]> 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, 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 then this should work just fine unless you run multiple threads reading input from the same terminal concurrently. Unfortunately, CHICKEN apparently doesn't support subsecond resolution for file-select. But the select system call usually does support that such that it should easily be possible to implement for example a wrapper for wgetch as a foreign-lambda* which does the appropriate timeout handling and returns #f in case of timeout. cu, Thomas _______________________________________________ Chicken-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/chicken-users
