Hello Monks,

I have a complex problem that I'm hoping has a simple answer. I have a very large dataset (~3.5GB) that I need to parallel process on a multi-core machine. In trying to use threads, I found that Perl creates a copy of the interpreter for each thread. This is a giant problem with a dataset this large, because it copies the entire contents of the memory into each thread, thus I run out of RAM very quickly. On linux, kernel threads allow the processes to share the same memory allocation, and it is up to you to lock appropriately using semaphores or whatever. 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? I would hate to have to go use Java or C to do this. Up until now, I was convinced Perl was unstoppable, please prove me right. :)


Thanks in advance!

--Ari

In reply to Using kernel-space threads with Perl by aberman

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.