in reply to Sharing Tk-module objects in threads

In the document for threads::shared pragmas, it says:

"bless is not supported on shared references. In the current version, bless will only bless the thread local reference and the blessing will not propagate to the other threads. This is expected to be implemented in a future version of Perl."
  • Comment on Re: Sharing Tk-module objects in threads

Replies are listed 'Best First'.
Re^2: Sharing Tk-module objects in threads
by kabeldag (Hermit) on Nov 05, 2004 at 03:30 UTC
    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 : _)

      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.