in reply to Re^2: update the hash element in side the thread loop
in thread update the hash element in side the thread loop
You've got use threads::shared; at the top of your code, but no where do you actually use it!
Ie. You never mark anything shared using my %hash :shared;, nor do you call the exported subroutine share() anywhere.
These are the only ways that threads can share variables. Without them, each thread will be operating on different variables (with the same name!).
What difference does it make to how your program runs if you add?
my %hash :shared;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: update the hash element in side the thread loop
by nagivreddy93 (Novice) on Nov 30, 2009 at 15:19 UTC |