in reply to Shared Thread Pool (used more then once,)
Are you sure that undef'ing a shared array is a correct way of clearing out the array? I might think you would use lock on @Data, and then do @Data = ();#for instance you have # Manage the thread pool until signalled to terminate while (! $TERM) { my $t; undef @Data; ################################# # and undef @Data; # Clear the shared array so that it can be used a +gain for the next for target
That brings up locking shared variables, your symptoms are similar to those where unlocked shared variables get clobbered by other threads accessing @Data.
See Threads: why locking is required when using shared variables
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Shared Thread Pool (used more then once,)
by BrowserUk (Patriarch) on Nov 15, 2013 at 21:51 UTC |