qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] experience with SDL2, event loop & main thread


From: Liviu Ionescu
Subject: Re: [Qemu-devel] experience with SDL2, event loop & main thread
Date: Mon, 12 Dec 2016 15:22:48 +0200

> On 12 Dec 2016, at 14:28, Fam Zheng <address@hidden> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]