Win VM modifications

Andreas Raab andreas.raab at gmx.de
Sat Mar 5 13:21:01 UTC 2005


Rob,

> This doesn't crash, but it doesn't do much either.  This prevents any wx 
> events from getting processed once you're in a callback, so when this 
> happens the wx window stops responding.

Interesting.

>> Good, good. Very good. Now on for the next try: What happens if you stub 
>> out the whole ioProcessEvents() loop (yes, everything) and just run the 
>> loop from the other process? Everything still fine?
>
> Not quite -- now nothing happens in the Squeak window. But that's because 
> the Squeak event recording needs access to the "lastMessage", which is set 
> at the start of ioProcessEvents.  If I add a hook to set lastMessage from 
> my wx event process, everything seems fine.
>
> But where does this leave us? It shows that we can move the event loop out 
> of ioProcessEvents, but this is a big change to the stock VM, and we're 
> back to an inefficient polling process. What do you have in mind next?

Well, there are two possibilites as far as I can tell at this point: Either, 
there is something in the wx mainLoop() which really wants to be run and 
isn't invoked by any of the current variants. We should be able to test this 
by calling interpret() from *within* the wx main loop. Try changing the main 
Squeak window proc (in sqWin32Window.c) to call interpret() ... uh say ... 
on WM_CREATE or so. Then, call the wx mainloop instead of interpret() from 
the VM and see if that works. If the problem is really in the "outer" 
mainloop this should probably work.

Or, and that's what I'm fearing right now, wx has a problem with reentrant 
windows messages. The only way to know for sure is probably to look around 
if anyone else has seen such a problem (and mind you it could just be an 
issue with one specific message - that's all it takes for a recursive 
crash). One thing that would indeed be useful is to find out after which 
recursive message the system crashes (if it were a specific one or two we 
might be able to handle these on the plugin level).

Cheers,
  - Andreas




More information about the Wxsqueak mailing list