Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^4: Slow evolution of Perl = Perl is a closed Word

by BrowserUk (Pope)
on Sep 01, 2007 at 07:24 UTC ( #636491=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Slow evolution of Perl = Perl is a closed Word
in thread Slow evolution of Perl = Perl is a closed Word

I suppose that depends on how many more years you're willing not to contribute somehow to getting a good multi-threading model in Perl.

The first step in achieving a good threading model is understanding the limitations of the existing one.

And the first few steps in doing that is realising that:

  1. the pthreads api has its own set of limitations and is far too low-level to use as the basis for threading in a HLL.
  2. fork is a piss poor model for threading.
  3. Copy On Write (COW) has little or no benefit when the C-level data structures representing Perl-level read-only variables are themselves routinely, internally mutated.
  4. for threading to be fully effective in a high level language, you need both kernel-space (pre-emptive) threading and user-space (cooperative) threading.
  5. Software Transaction Memory (STM) only works for undoable (re-startable) operations.

    If STM is the only state-sharing mechanism, then a very high proportion of the situations and algorithms that most benefit from threading can no longer be coded!

    • You can't undo changes to the file-system, so copy, move, rename, delete etc.

      Whilst it is conceivable to wrap these FS primitives such that they might be undone if the STM requires rollback, other processes may have noticed and acted upon the changes

    • You might attempt buffering reads and writes to files internally, until the STM commits?
    • What do you do for pipe and socket operations?

    STM promises an efficient solution to shared-state memory operations which can benefit some classes of algorithm (the kinds of things PDL does for instance), but it holds little promise for a huge range of other threading scenarios.

Did you ever visit one of those Echo Canyons, yell, and wonder if anyone is listening?

Did you ever stick your head into a lion's cage to try and pursuade it to become a vegetarian?


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.


Comment on Re^4: Slow evolution of Perl = Perl is a closed Word
Re^5: Slow evolution of Perl = Perl is a closed Word
by chromatic (Archbishop) on Sep 04, 2007 at 04:53 UTC
    Did you ever visit one of those Echo Canyons, yell, and wonder if anyone is listening?

    Funny; as I type this, I'm running Parrot's language tests just before a checkin of working code. Now it's not threading code per se, but it's working code.

      Funny; as I type this, I'm running Parrot's language tests just before a checkin of working code.

      Really. That's great. I'm not sure how Parrot relates to what I've said in this thread? Nor even to anything I've ever said about Parrot?

      Now it's not threading code per se, but it's working code.

      But then again...if it is possible to create Parrot code, but not to create a thread to run that Parrot code, then could that be an indication that threads on Parrot is going to be another tack-it-on-later solution?

      To the -- wielder: feel free to kneejerk again on this thread. It won't change the significance or truth of the post, but you'll feel better.


      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.
        Really. That's great. I'm not sure how Parrot relates to what I've said in this thread? Nor even to anything I've ever said about Parrot?

        It's simple. A person can talk and talk and then complain about how no one jumps to write code for said person, or a person can write code. I choose the latter.

        But then again...if it is possible to create Parrot code, but not to create a thread to run that Parrot code, then could that be an indication that threads on Parrot is going to be another tack-it-on-later solution?

        That really depends on what you mean by "tack-it-on-later". The concurrency PDD is still unfinished, and, as such, not completely implemented. Here's your chance to suggest a better threading model than ithreads or pthreads.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2014-12-25 09:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (159 votes), past polls