in reply to Creating a hash within a fork

I just realized that since it is being forked, each process is independent so I am assuming the hash reference isn't being shared across all the processes. I am not sure how to get around that. Thanks again.

Replies are listed 'Best First'.
Re^2: Creating a hash within a fork
by BrowserUk (Patriarch) on Jun 04, 2015 at 19:43 UTC
    I am not sure how to get around that.

    Sharing a hash between threads is easy. Not fast; but easy.

    Alternatively, if you're scared of threads; consider looking MCE which provides a mechanism for appearing to share data between forks that is pretty transparent to the using code.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
    In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked
Re^2: Creating a hash within a fork
by marioroy (Prior) on Jun 05, 2015 at 01:43 UTC

    I apologize, but MCE::Shared is not available on CPAN at this time. MCE::Shared supporting processes is coming soon. It will be released with MCE 1.7. But there is hope and will use MCE's gather capability in a subsequent post.