in reply to Perl Tk and Threads

Darn... I was hoping to use threads to create a splash screen while a rather complex GUI was being constructed at the start of a perl script. (It's not really the GUI that takes a long time to construct, it's the harvesting of data to populate it).

My current solution was to fork off a child process to display the splash and then send a kill 9 (KILL) to it when the main GUI was ready.

Guess I'll stick with this rather kludgy/brute force method.

Replies are listed 'Best First'.
Re^2: Perl Tk and Threads
by Anonymous Monk on Aug 21, 2012 at 15:10 UTC

    You're using threads! But they're heavy-weight threads (vs. the light-weight threads previously discussed). It might be heavy-handed, but it's not brutal. And it gets the job done!

    As wikipedia says, "a thread is a lightweight process." The flip side is that a process is a heavyweight thread. In your case, since you spawn (fork) the thread, it runs independently of the parent thread, and then exits, you probably wouldn't see much difference in performance, especially if you fork before the parent process has gotten fat.