> On 12 Dec 2016, at 14:28, Fam Zheng <f...@redhat.com> wrote: > > ... Take a look at event_notifier_set_handler() and event_notifier_set(). > ... qemu_bh_new() and qemu_bh_schedule(). > > Both can register a callback that will be called in main loop once fired.
ok, thank you, I'll consider them. if I understand it right, this is a more portable alternative of using the SDL user events, to forward actions from the device thread to the main thread. but this is only part of the problem, in addition to user events, graphical libraries also generate system events (like mouse, termination, etc) usually consumed by a kind of event loop. probably it is possible to set a notifier handler to run the SDL PollEvent, but, at least for SDL, I did not find any function in the public API to add a hook to trigger events associated with system events. so, back to square one; any suggestion on how to avoid the periodic timer required to poll SDL system events? regards, Liviu