When you use ithreads properly, you create the threads soon, when there are only very few data in the heap, and you use as few shared data as possible. When ithreads is used this way, it should be reasonably fast.

This means that the ithreads model is not ideal for some tasks you could normally do with threads. Ithreads are, however, very good for tasks where the threads do almost independent work, such as fork emulation or servers handling multiple connections. It is not suited for other tasks, such as tasks with heavy paralel computation imo.

Thus, I aggree with your original post in that ithreads might not always be what you want.

I do not know about any high level language supporting a thread model similar to for example pthreads, probably because that would make the interpreter unstable when you do not uses locks properly (5005Threads were like that iirc). If you need such threads, you migt want to look at other languages than Perl. Ruby has continuation-based threads, that means of course that it uses only one cpu at a time.


In reply to Re^3: TIMTOWTDI vs. ithreads by ambrus
in thread TIMTOWTDI vs. ithreads by nothingmuch

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.