Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
From the standpoint of Perl 6 (the language), we've thought about a lot of these things from the standpoint of fundamentals. What you find in the draft concurrency spec is more like a laundry list of things people would like. However, part of the reason we've not bothered much with that document is precisely because concurrency must be built into the design from the ground up, not because we're ignoring the topic. Hence, just off the top of my head, in the basic design of Perl 6 you will find various reassuring tendencies:
  • All blocks are (potentially) closures
  • Data tends to be well-typed even if the user doesn't realize it
  • Emphasis is on reentrancy via use of lexicals rather than globals
  • Most Perl 5 globals are gone or are no longer global
  • The global footprint of a Perl 6 thread can be a lot lighter than a Perl 5 interpreter
  • Globals and other strangely scoped variables must be syntactically distinguished with twigils
  • Strictness is now default, so no accidental globals
  • Mutable vs immutable data is semantically distinguished
  • Default of formal parameters is readonly
  • State variables are explicitly declared and clone as lexical variables do
  • Tied variables must be explicitly declared
  • Context lexicals encouraged over temporized globals
  • Most objects stored in opaque storage
  • Mutating methods are syntactically distinguished
  • Symbolic vs hard reference syntactically distinguished
  • Constants are known to be constant at compile time
  • Hyperops, junctions, and feeds all make specific promises about lack of interactions
  • Exceptions may easily be treated as undefined data when doing parallel operations
  • Lazy lists encourage reentrant programming
  • Patterns are reentrant so they can be used in multiple threads on different strings simultaneously
  • Grammars and other logic programs are designed to be allow multiple "in flight" hypotheses in parallel
These bits of design all contribute to easier concurrency, but are spread out over all the existing synopses, and most of them are not explicitly labeled as "concurrency support". That is not to say that there are not still many open issues, and as you say, we'll have ample opportunity to discuss them.

Specifically with regard to STM, while STM doesn't itself address the issue of non-reversible external operations, I think it does potentially address the issue of acquiring the locks in preparation for doing such an operation, since the locks themselves are presumably in memory. And I suspect that STM can be extended to manage anything that can be construed as "memory" as long as it has reversible characteristics.

Anyway, in many cases I think the compiler will have enough hints to determine whether the code is reentrant and whether the data has to be shared without forcing ordinary users into a monadic lifestyle. And where the compiler is not so sure, it can likely ask the programmer politely for a few more clues. In any case, the Perl 6 language is mutable and strongly versioned, so we can hopefully fix it where it goes wrong.


In reply to Re^2: Slow evolution of Perl = Perl is a closed Word (NQP, parrot concurrency == Oh dear.) by TimToady
in thread Slow evolution of Perl = Perl is a closed Word 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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-03-19 03:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found