Dear Enlightened Monks..

I have to create & populate a new large hohoh hash-of-hash structure, cooked out of another input hoh structure, which I am reading from a file by Storable retrieve functionality.

I am using Thread::Queue

The problem I am facing ::

Issue.1 : I thought with shared_clone I can create a deep copy of entire hoh - Using threads [Version 1.92] & threads::shared [Version 1.46].

my $indb = retrieve('input_hash.perl.db'); my $copydb = shared_clone( $indb ); .. .. my $thr1 = threads->new(\&thrd_run, $copydb); ..

not working

==========

For the time being as input db is not too large - I am repeatedly retrieving from inside every thread-run [ sub thrd_run ] - i don't like this - I want to retrieve the db only once - and want to reuse / use cloned copy / shared copy of the same and pass it to every thread. Is is possible?

Issue.2 : I wish to create another hohoh [a tree - with approx leaf node numbers > 60M - after few different depth of branched-hierarchies ] - I wish to populate this hohoh structure from inside my thread runs - shared write into a hohoh ref.. is that possible?

Even if no, what would be a good alternative plans.

Thanks a bunch in advance..

Any light will help in the dark..


In reply to Is it possible to create a single Hash-of-Hash.. with multiple threads.. by gsat

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.