[reactive] filterMP on keyboard-event taking 100% cpu

Mathijs Kwik bluescreen303 at gmail.com
Sun Apr 11 06:38:34 EDT 2010


Hi all,

I decided to have another try with reactive and got the basics working.
I created a simple program that just beeps until a timeout is reached
or when a key gets pressed.

This works OK, so I wanted to take it a small step further.
Now, I only wanted to stop if the 'q' key is pressed (or timeout is reached).

I tried filterE, filterMP and the alternative definition of filterMP
found in the source.
I found that in all cases, one thread of the program immediately grabs
100% cpu and makes the program sluggish/unresponsive.

I'm on ghc 6.12.1 and compiled without any optimizations.

here is my example:
http://hpaste.org/fastcgi/hpaste.fcgi/view?id=24810
(everything works when "stopper" uses "keyevent" but breaks on "qevent¨)

Is there anything I can do to get the behavior I want?

Thanks,
Mathijs


More information about the Reactive mailing list