[Vm-dev] Cog: Possible caveat with ioProcessEvents on linux

Igor Stasenko siguctua at gmail.com
Mon Jul 29 22:54:05 UTC 2013


Yesterday we were hacking VM with Laurent,
to implement idea which i talked about before:
 - replace direct call to ioProcessEvents with call to
ioProcessEventsPtr (a function pointer),
but only if its not nil.
That gives a possibility to replace or completely suppress VM's
default event handling.

But after simple changes, and putting null value to that pointer, we
discovered that image still
responds and keeps handling events, like nothing happen.
We found that X11 driver uses AIO callbacks which get called any time
something happen
with Display file descriptor.
That mean following:
 - any X11 event get handled immediately as it appears in queue (which
is pretty neat)
 - the call to ioProcessEvents() during interrupt check is not
necessary (as well as in many other places)
 - the inIOProcessEvents flag won't work as advertized because it is
completely ignored, since events
handled via callbacks.

we made changes to honor ioProcessEventsPtr, and actually call it,
instead handleEvents()
in aio callback.

Comments?

-- 
Best regards,
Igor Stasenko.


More information about the Vm-dev mailing list