Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: Parrot, threads & fears for the future.

by BrowserUk (Patriarch)
on Oct 23, 2006 at 20:33 UTC ( [id://580148]=note: print w/replies, xml ) Need Help??


in reply to Re: Parrot, threads & fears for the future.
in thread Parrot, threads & fears for the future.

Sorry, but anyone who thinks that programming state machines with iddy-biddy bits of code, global state and

for my $counter( GLOBALSTATE->{LOOPCOUNT} .. 1000 ) { IsSomethingElseReadyToRunYet(); ## do a bit IsSomethingElseReadyToRunYet(); ## Do a bit more OhGodSomethingElseIsReadyToRun() and do{ GLOBALSTATE->{LOOPCOUNT} = $counter; # 3! last; }; ## Stuff we might get around to doing next time through...maybe }

is easier than remembering to lock() a variable, is perverse :)

This is humour and no reflection on you, Matts or anyone else. I think state machines suck.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^3: Parrot, threads & fears for the future.
by perrin (Chancellor) on Oct 23, 2006 at 20:51 UTC
    I think non-blocking I/O is pretty hard, as evidenced by the fact that POE is still not very widely used. It can provide impressive results in the hands of skilled programmers though. It was the secret sauce that allowed the original (pre-web) AOL to scale on the hardware that was available back then.

      In my opinion, POE is not widely used because non-blocking IO is hard but because POE itself isn't a nice programming model. I've programmed a bit with Coro, and there, the non-blocking IO is almost invisible. Unfortunately, Coro doesn't compile on native Windows and at the time it had some stability problems on Linux too, with glibc5, so I stopped using it.

Re^3: Parrot, threads & fears for the future.
by tirwhan (Abbot) on Oct 24, 2006 at 08:49 UTC
    I think state machines suck

    Heh, I just can't resist pointing out my favourite quote by Alan Cox, which pretty much answers the OP as well:

    A computer is a state machine. Threads are for people who can't program state machines.

    (Cue people screaming that he's talking about OS threads, not userland threads, yadda, yadda ;-)


    All dogma is stupid.

      This has come up before, I answered it before (last para), but much prefer renodino's answer to that directly, or my own somewhat more explanatory, but indirect earlier answer (last two paras).

      Or perhaps Mr. Cox should think about this.

      Computers use binary, but we do not program in it.

      Computers are dumb; (most) human beings aren't.

      Computers never forget; most human beings do.

      Human beings usually learn from their mistakes, computers will continue to make mistakes--very, very quickly--until they are either stopped, or crash.

      The purpose of computers is to make the lives of human beings easier, not to force us all to become computer-like.

      Slogans that portray elitist attitudes, do not reflect well upon their authors.


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

        <shrug> to be honest, I have no real desire to debate the pros-and-cons of threads with you, because I have in the past tried (and failed) to understand what kind of mindset is required to simultaneously consider programming state machines difficult and thread-induced problems manageable. Personally, I'd amend renodino's amendment to:

        Threads are for people who can't have better things to do than program state machines but instead prefer to waste time debugging concurrency and verification issues

        but that's just me. I suspect it's a kind of vim vs. emacs and Linux vs. Windows debate, so best left alone.

        But your post does indicate to me that you probably still don't know who Alan Cox is and haven't looked into the history and discussion surrounding that quote. You may want to consider doing that (and here's a quick pointer at one such discussion), you might learn something and become a bit more cautious with the word "elitist". Just a thought.


        All dogma is stupid.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://580148]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2024-04-19 11:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found