Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^5: Is it possible to create a single Hash-of-Hash.. with multiple threads..

by BrowserUk (Pope)
on May 03, 2014 at 07:46 UTC ( #1084870=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
                if( exists $copyRef->{ $step } ) {
                     $copyRef = $copyRef->{ $step };
    ...
                     lock %{ $copyRef };
                     $copyRef = $copyRef->{ $step } = &share( {} );
                 }
    
  2. or download this
                lock %{ $copyRef };
                $copyRef = $copyRef->{ $step } //= &share( {} )
    
  3. or download this
    ...
    my %subhash;
    ...
    lock %mainSharedHash;
    $mainSharedHash{ $key } = shared_clone( \%subhash );
    ...
    
  4. or download this
    ...
    my %subhash :shared:
    ... # populate it
    lock %mainSharedHash;
    $mainSharedHash{ $key } = \%subhash;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1084870]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2015-04-25 22:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who makes your decisions?







    Results (481 votes), past polls