in reply to Using kernel-space threads with Perl

Is this possible in Perl, or is there a strategy I can use that won't involve copying the entire contents of memory into each iThread?

Unfortunately, there is no way to do this efficiently in Perl if every thread needs to be able to access all the data.


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.
  • Comment on Re: Using kernel-space threads with Perl

Replies are listed 'Best First'.
Re^2: Using kernel-space threads with Perl
by aberman (Initiate) on Mar 21, 2011 at 23:54 UTC

    Each thread does not necessarily need to see all the data. The job is embarrassingly parallelizable, so I was going to simply carve it up into pieces. The problem was getting each of the pieces into the threads. If I split up the data before hand, then all of it still gets copied into the threads. Maybe I'm using the wrong strategy?

    Thanks!
      The job is embarrassingly parallelizable, so I was going to simply carve it up into pieces.

      Then it may be possible to do something useful. It depends on wher you are getting the data from and how it can be subdivided.

      A little more information about the data and the processing to be performed on that data might suggest a better technique.


      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.

      Create the threads first and then have each thread load just the data it needs (and don't share it, of course). Then there won't be extra copies of that stuff created.

      - tye        

        Would you care to expand that a little?

        Say, a little pseudo-code showing how you would manage the threads reading from the same file concurrently?


        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.