Re: Run Io coroutines in background simultaneous to using Io> prompt in foreground?
On 2009-06-09, at 10:09 PM, dennisf486 wrote:
> Thanks that was a big help but it wasn't quite the solution. I was
> able to make it run a background process simultaneous to generating
> my own prompt. But that only solves half my problem: "EditLine
> readLine" is a blocking call, so it still halts other coroutines
> while waiting at the "fake Io>" prompt. (Because you can't yield
> between keypresses.) So it still only executes the background loops
> once per every time I hit the "return" key on a command in the prompt.
The simplest solution may be to use a non blocking keyboard input
call. If this is all command line stuff, then you might look at the
curses binding (but may have trouble making it portable). If it's in a
GUI liek GLUT/OpenGL, then you can just use its' event based keyboard
input.