On Mon, 17 Nov 2003 11:02:49 +0000, Nick Ing-Simmons <nick.ing-simmons@elixent.com> wrote: >>I recognize that this is Windows specific, but at least on Windows it is >>not safe to call PERL_GET_CONTEXT from a Window callback. > >Which is why I don't claim even Tk804 to be thread ready yet. This is unrelated to threading. I've seen crashes (of Win32::GUI, not Tk) in a singled threaded application, embedding just a single Perl interpreter. The sequence of events was: * App sets context, calls into Perl * Perl code creates dialog * User terminates dialog * Perl returns to App * App restores context (to NULL, as there is no other interpreter) * Windows dispatches another message (WM_SETFOCUS) to the dialog * Dialog does PERL_GET_CONTEXT, sets context, calls into Perl and crashes A workaround here was to globally set the context once the Perl interpreter was created. But the real bug was Win32::GUI calling PERL_GET_CONTEXT in a window procedure. If the App had been switching between multiple interpreters, this workaround would not have been possible. I don't know if this scenario is possible with Tk too; I just wanted to alert you that it is a potential source of problems. Cheers, -JanThread Previous | Thread Next