He will want multiple timers checking different things simulanaeously.

And that just shows the depth of your misunderstanding.

Timers do not happen "simulanaeously.". They happen serially. And all on the same thread.

And if the processing required in response to one of these artificial events takes too long, then you start missing events. So then you have to create more timers and more states and break up the response code into iddy biddy chunks to try and avoid missing events. And then you have to tune those iddy biddy chunks of code each time you move to a different cpu.

And when your workload increases to the point that your code can no longer keep up with the demand, you move it to new machine with 16 times power; BUT IT DOESN'T HELP ONE JOT!

It can only utilise 12.5% of your 8-core CPU. Or 6% of your 16-core cpu. or 5% of your 10-core, hyperthreaded cpu.

Or less than 0.1% of your new 256-core, 1024-thread SMP server.

Because your single-threaded, event-driven architecture DOESN'T SCALE!

Your continued attempts to push this ancient, evolutionary dead-end of software architecture, despite that it is so obviously completely unsuited to the realities of modern hardware, is--and I'm sorry to re-use this word, but it is appropriate and measured--asinine.


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.
RIP an inspiration; A true Folk's Guy

In reply to Re^8: Should I use threads? Perl/DHCP/Radius by BrowserUk
in thread Should I use threads? Perl/DHCP/Radius by Anonymous Monk

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.