Win VM modifications

Rob Gayvert rtg at rochester.rr.com
Sat Mar 5 02:34:23 UTC 2005


Andreas Raab wrote:

>>> Again, any chance of finding out where it crashes?
>>
>> Okay, here's where it gets interesting. If the wx pre-processing is 
>> applied, simple isolated events work fine. But if an event comes in 
>> during a callback, it crashes in a completely random way. What's 
>> happening here is a sequence like:
>>    interpret -> ioProcessEvents -> wxProcessMessage -> [...] -> 
>> interpret() -> ioProcessEvents -> ...
>> With a separate process polling for wx events, re-entry of the 
>> interpreter occurs only during a primitive call.
>
> An RSTTT (Really Simple Thing To Try) would be to do, say,:
>
> ioProcessEvents {
>    static int inCallBack = 0;
>
>    if(!inCallBack) {
>        /* only do wxProcessMessage if not in callback */
>        inCallBack := 1;
>        wxProcessMessage(...);
>    }
> }
> Does this work? (if it does work reliably, we just solved the problem)

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. What happens if you take out the test here:
>>>
>>>>        if (msg.hwnd != stWindow){
>>>
>>> Does this crash? (this would clearly point to a problem in the wx 
>>> libs).
>>
>> No, it works fine, so the wx pre-processing doesn't seem to hurt.
>
> 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?






More information about the Wxsqueak mailing list