Allegedly, STM has huge drawbacks as a basis for concurrency

jjore on 2007-02-09T18:12:09

Lamba the Ultimate at http://lambda-the-ultimate.org/node/2048> posted an article pointing to an article by Patrick Logan at . I only know the shared memory+locks of most "normal" programming and have only slight experience with Mozart/Oz which I hear is somewhat close to Erlang's ideas of shared-nothing.
I thought this was an interesting discussion and wanted to cross-post it just to possibly see what reaction this kind of pushback has from the Perl 6 camp where STM seems to be the cat's meow.


As seen on #perl6...

audreyt on 2007-02-09T23:32:37

<audreyt> Limbic_Region: well, the point is valid, that share-everything has drawbacks
<audreyt> STM fixes the drawbacks to a degree but still if you can design the code to share nothing, the better
<audreyt> not really sensational :)
<allbery_b> he's right, share-nothing is ideal.  so's world peace.  both are about equally likely...

In other words...

audreyt on 2007-02-09T23:39:33

It's not really "STM has huge drawbacks as a basis for concurrency", but rather "sharing data among concurrent processes creates complexity" -- In practice, when it's desirable to have _some_ data shared, STM is one of the best way we know about to manage that complexity.

Re:In other words...

chromatic on 2007-02-10T19:17:37

Agreed. The goal here in language design may be to encourage shared-nothing where it's appropriate (that is, almost everywhere) and making shared-something much less dangerous where it's absolutely necessary.

Re:In other words...

audreyt on 2007-02-11T03:43:12

Yup. And I think having fork and async being the triggers for the two sharing models, respectively, and enable "my $x is shared" work transparently across forked processes, may be a fruitful way to go.

Also, GHC 6.8 will come with a unified thread/event model that let people flip between explicit-sharing event "view" and implicit-sharing thread "view" freely, instead of maintaining an adhoc per-thread event queue; this also greatly simplifies asynchronous programs, while preserving linearly-scalable SMP performance.