in reply to Re^2: Running a threaded Tk script on Windows
in thread Running a threaded Tk script on Windows

Thanks for the ideas. But I do spawn the threads before I start any Tk code, and it does run fine on linux.
Just because it works on linux doesn't mean its supposed to :) and the mere act of useing the module executes code. From perlthrtut
If you're using a module that's not thread-safe for some reason, you can protect yourself by using it from one, and only one thread at all. If you need multiple threads to access such a module, you can use semaphores and lots of programming discipline to control access to it.
Tk is not thread-safe.

MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
** The third rule of perl club is a statement of fact: pod is sexy.

  • Comment on Re^3: Running a threaded Tk script on Windows

Replies are listed 'Best First'.
Re^4: Running a threaded Tk script on Windows
by zentara (Cardinal) on Sep 16, 2005 at 12:55 UTC
    Well, I rewrote a Windows version which loads and starts the threads before I require any Tk modules, and it still fails. It just brings back all the nightmares which made me dump Windows to begin with. Screw Windows!! ;-)

    I'm not really a human, but I play one on earth. flash japh
    • Don't load stuff, particularly stuff with XS elements, prior to creating threads that do not use that stuff. Specifically, loading (useing) Tk; means that pats of it will be loaded into multiple threads regardless that it is not used in them all. Thins is a recipe for problems.
    • Don't port code, especially threaded code) to Windows ME first. Use NT/2K/XP and then backport to ME (if all your attempts to avoid doing so fail).

      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
      "Science is about questioning the status quo. Questioning authority".
      The "good enough" maybe good enough for the now, and perfection maybe unobtainable, but that should not preclude us from striving for perfection, when time, circumstance or desire allow.
        Don't load stuff, particularly stuff with XS elements

        Well to trace down the problem, I stripped out all Tk code, and the problem is in the creation of the shared variables. I will post another question with a minimal example, using no XS.

        Don't port code, especially threaded code) to Windows ME first. Use NT/2K/XP

        Well, Me is all I have, and I simply refuse to feed the "beast from Redmond" anymore.


        I'm not really a human, but I play one on earth. flash japh