Hey, 2014-04-08 11:53 GMT+04:00 Kirill Timofeev <[email protected]>:
> while loop was copy pasted from example I used as starting point. While > loop is needed to run program forever, but looks like adding event handlers > should be done in the loop as well. Frankly speaking I don't understand how > all watchers were dropped in my case. > As far as I can tell, it indeed runs your program forever consuming 100% cpu. The documentation on ev_run says the following: > If the flags argument is specified as 0, it will keep handling events until either no event > watchers are active anymore or ev_break was called. So I would suggest removing the while loop and double checking that watchers are being active all the time. If you cannot guarantee that, you can add some dummy watcher which will be active. Another approach is to play with ev_ref/ev_unref to make the loop think it's still used. -- Regards, Konstantin
_______________________________________________ libev mailing list [email protected] http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev
