[Development] Reviews needed before android integration in two weeks

BogDan bog_dan_ro at yahoo.com
Wed Feb 6 20:51:17 CET 2013


>>  On Android all events are coming from another thread, and some time a few

>>  events are not delivered by the event loop. It happens because if an event
>>  is  added to the event loop when the event loop just started to
>>  process/deliver the  events this event is not sent because the event loop
>>  "goes to sleep" (calls the QEventDispatcherUNIX::select(...) 
> function), my
>>  patch prevents the call of select function if a new event was just added.
> 
> That explanation is not specific to Android. It looks like a real case for any 
> postEvent. Therefore, this change -- as described -- must be in QtCore or 
> nowhere at all.
> 
> However, your explanation is either mistaken or incomplete. The select() call 
> will not sleep because the pipe or eventfd will have unread data: instead, it 
> will wake up immediately. Then the event dispatcher will realise that there 
> are more events in the queue and will proceed to dispatch them.
> 
> I don't doubt that you found a deadlock condition somehow. But I am not 
> convinced that you understood it correctly or that you fixed it properly.
> 

I think I understood how the event loop is supposed to work, sadly, at least on
android, it doesn't work as it should. Is very simple to check it, just revert that
patch and test an UI application that doesn't have any active timer, you should
see the missing events immediately when you tap on the device (push a button
or something). I didn't said is a deadlock, what I'm trying to say is that the
event loop doesn't wake up immediately.

BogDan.




More information about the Development mailing list