haskell-libui icon indicating copy to clipboard operation
haskell-libui copied to clipboard

Some examples run at 100% CPU usage

Open nh2 opened this issue 6 years ago • 3 comments

E.g. libui-simple-counter-example, 100% CPU in htop

In strace it's busy-looping around poll (because poll() is given a 0-timeout):

[pid 31736] recvmsg(11, 0x7ffe9da1db20, 0) = -1 EAGAIN (Resource temporarily unavailable)
[pid 31736] poll([{fd=11, events=POLLIN}, {fd=12, events=POLLIN}, {fd=13, events=POLLIN}], 3, 0) = 0 (Timeout)
[pid 31736] recvmsg(11, 0x7ffe9da1db20, 0) = -1 EAGAIN (Resource temporarily unavailable)
[pid 31736] poll([{fd=11, events=POLLIN}, {fd=12, events=POLLIN}, {fd=13, events=POLLIN}], 3, 0) = 0 (Timeout)

Not sure if it's an issue with libui or haskell-libuil, or the example code calling the functions wrong.

nh2 avatar Feb 08 '18 03:02 nh2