in reply to Re: Sharing Tk-module objects in threads
in thread Sharing Tk-module objects in threads

Couldn't I solve the problem by using a global IO::Handle to communicate between threads, or use a named pipe ? Help me out here : _)
  • Comment on Re^2: Sharing Tk-module objects in threads

Replies are listed 'Best First'.
Re^3: Sharing Tk-module objects in threads
by pg (Canon) on Nov 05, 2004 at 03:39 UTC

    If I switch those two lines as you mentioned:

    create_tk_window();#this was after the next line threads->new(\&update_thread)->detach;

    It appears to work to some extent, but after a while, yuo get errors. However i tried twice, and got different message each time. Once it said:

    update_thread called... Free to wrong pool 223f40 not 1bcf528 at C:/Perl/site/lib/Tk.pm line 4 +06. Attempt to free unreferenced scalar: SV 0x1e7643c at C:/Perl/site/lib/ +Tk.pm line 247.

    That was the same error you mentioned that you saw. But the second time, I saw a different message (but the program does not fail for a long time, I killed it at the end):

    Attempt to free non-existent shared string '_TK_RESULT_' at C:/Perl/si +te/lib/Tk. pm line 247. Attempt to free non-existent shared string '_TK_RESULT_' at C:/Perl/si +te/lib/Tk. pm line 247.