Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: Postpone garbage collection during a child process run?

by sundialsvc4 (Monsignor)
on Oct 06, 2010 at 15:11 UTC ( #863807=note: print w/ replies, xml ) Need Help??


in reply to Re: Postpone garbage collection during a child process run?
in thread Postpone garbage collection during a child process run?

I agree 100% with this assessment:   you have a nasty logic-error in your code.

In addition to "Thread::Queue," you should also review what is contained in the Perldoc entry for threads::shared ... particularly the BUGS AND LIMITATIONS and the SEE ALSO sections.

Sharing of information among multiple threads does not work reliably, in the manner that you are now attempting to do so, even if it seems to do so in testing.   (Hate to be the bearer of bad news, but then again, thread-related issues are often like that.)   Your notion of “delaying garbage collection” will lead to even more problems; it is a blind alley.


Comment on Re^2: Postpone garbage collection during a child process run?
Re^3: Postpone garbage collection during a child process run?
by BrowserUk (Pope) on Oct 06, 2010 at 16:54 UTC
    (Hate to be the bearer of bad news,

    Then just stop!

    particularly the BUGS AND LIMITATIONS and the SEE ALSO sections.
    • Bugs and limitations amount to:
      • share( <hashref>!<arrayref>) unituatively empties the structure being shared.

        Now fixed by the provision of shared_clone().

      • splice doesn't operate on shared arrays.

        Big deal, not!

      • Taking a ref to a shared structure elements doesn't autovivify.

        Many people wish that Perl didn't autovivify so readily anyway. Again No big deal.

      • refaddr() reports the thread local alias address, not the that of the principle.

        Use IsShared() to obtain a cross-thread usable identifier.

      • each can produce incorrect results when run against nested hashrefs.

        Make a local copy the the hashref and run each on that. Simple.

    • See also contains nothing but a list of useful links.

      So why make it sound like it contains a government health warning?

    A few limitations, with solutions. No big deal.

    And all aimed at someone who didn't mention threads and isn't using them. Stop jumping on bandwagons that you don't understand!

    Have you actually written any threaded perl code?

    Because your pronouncements on the subject show little or no understanding of the real issues involved.


    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".
    In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2014-08-23 16:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (174 votes), past polls