Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
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 cooling their heels in the Monastery: (5)
As of 2016-02-08 07:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?





    Results (268 votes), past polls