<?xml version="1.0" encoding="windows-1252"?>
<node id="424182" title="Re: Things you need to know before programming Perl ithreads" created="2005-01-21 23:17:10" updated="2005-07-07 15:05:21">
<type id="11">
note</type>
<author id="59600">
BrentDax</author>
<data>
<field name="doctext">
&lt;blockquote&gt;&lt;i&gt;Now you may wonder why Perl ithreads didn't use fork()? Wouldn't that have made a lot more sense? Well, I wasn't involved in the thread design process at the time, so I have no idea what the exact reasons were.&lt;/i&gt;&lt;/blockquote&gt;
&lt;p&gt;
    Hysterical raisins--surprisingly good ones, but still
    hysterical raisins.  ithreads were originally developed
    to emulate &lt;i&gt;fork&lt;/i&gt;(1) on Windows, which doesn't have
    such a call; thus, they couldn't be built on 
    &lt;i&gt;fork&lt;/i&gt;.
&lt;/p&gt;
&lt;p&gt;
    Besides, as your &lt;code&gt;forks&lt;/code&gt; module demonstrates,
    most of the speed wins of using &lt;i&gt;fork&lt;/i&gt;(1) on 
    systems that have it would be lost in the interthread 
    communications.  The general consensus seems to be that 
    you should use ithreads in code with a lot of 
    interthread communications, a magic &lt;i&gt;open&lt;/i&gt; (or 
    such) in code with a little communication, and a raw 
    &lt;i&gt;fork&lt;/i&gt; in code with very little communcation.
&lt;/p&gt;
&lt;!-- Node text goes above. Div tags should contain sig only --&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-59600"&gt;
&lt;P&gt;=cut&lt;BR&gt;
--Brent Dax&lt;BR&gt;
There is no sig.
&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
288022</field>
<field name="parent_node">
288022</field>
</data>
</node>
