
glover510
New User
Feb 3, 2011, 3:04 PM
Post #1 of 1
(594 views)
|
Problem sharing hash across multiple threads
|
Can't Post
|
|
Writing a Perl Tcl/Tk GUI application. Need to share a hash across multiple perl threads. In particular, this hash is the TixGrid. When I print out the address of the instance of the TixGrid outside of the thread, I get one value, and I print out the address of the instance of the TixGrid inside the thread I get another address. Then when I try to set a value of the TixGrid within the thread the program crashes. The TixGrid instance is stored in a parent hash, like $mydata->{mytixgrid}, and I do declare the mydata shared via: my %mydata : shared; I also did try to declare $mydata->{} shared via: share($mydata->{}); but the perl interpreter did not recognize the share function, eventhough I have: use Threads; use Threads::Shared; Any help would be appreciated. Also, I can explain more about the structure and purpose of this program and my motivation for needing to share a TixGrid across multiple threads if interested. Thanks, Michael
|