Merlyn's pithy quote puts me in mind of one of Larry McVoy's, on the same subject: "Threads are like salt. You like salt, I like salt, but we eat a lot more pasta than salt."

Which I take as saying that even if you thread, you shouldn't really have one thread per logical activity (as is common). Threads are at their best (as are processes) when their number is a small multiple (2 or 3) times the number of execution cores in your system (i.e. number of processors, give or take a bit of hyperthreading or dual-core action).

This leads to approaches such as thread pools and producer/consumer relationships between threads. This also leads to healthy behaviour such as avoiding repeated startup/shutdown of threads and processes. (OSes vary as to the relative costs of starting up threads and processes. But even so, it isn't something you want in your fast path if you're looking at performance. And lots of people interested in threading are).


In reply to Re: Responsive GUI without threads by jbert
in thread Responsive GUI without threads by ruoso

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.