[Haskell-cafe] Re: Can you do everything without shared-memory concurrency?

Bruce Eckel bruceteckel at gmail.com
Fri Sep 12 11:07:53 EDT 2008

OK, let me throw another idea out here. When Allen Holub first
explained Actors to me, he made the statement that Actors prevent
deadlocks. In my subsequent understanding of them, I haven't seen
anything that would disagree with that -- as long as you only use
Actors and nothing else for parallelism.

If someone were to create a programming system where you were only
able to use Actors and nothing else for parallelism, could you do
everything using Actors? Is there anything you couldn't do?

I'm assuming again that we can throw lots of processors at a problem.

On Thu, Sep 11, 2008 at 8:17 PM, Aaron Denney <wnoise at ofb.net> wrote:
> On 2008-09-10, David Roundy <droundy at darcs.net> wrote:
>> On Wed, Sep 10, 2008 at 03:30:50PM +0200, Jed Brown wrote:
>>> On Wed 2008-09-10 09:05, David Roundy wrote:
>>> > I should point out, however, that in my experience MPI programming
>>> > involves deadlocks and synchronization handling that are at least as
>>> > nasty as any I've run into doing shared-memory threading.
>>> Absolutely, avoiding deadlock is the first priority (before error
>>> handling).  If you use the non-blocking interface, you have to be very
>>> conscious of whether a buffer is being used or the call has completed.
>>> Regardless, the API requires the programmer to maintain a very clear
>>> distinction between locally owned and remote memory.
>> Even with the blocking interface, you had subtle bugs that I found
>> pretty tricky to deal with.  e.g. the reduce functions in lam3 (or was
>> it lam4) at one point didn't actually manage to result in the same
>> values on all nodes (with differences caused by roundoff error), which
>> led to rare deadlocks, when it so happened that two nodes disagreed as
>> to when a loop was completed.  Perhaps someone made the mistake of
>> assuming that addition was associative, or maybe it was something
>> triggered by the non-IEEE floating point we were using.  But in any
>> case, it was pretty nasty.  And it was precisely the kind of bug that
>> won't show up except when you're doing something like MPI where you
>> are pretty much forced to assume that the same (pure!) computation has
>> the same effect on each node.
> Ah, okay.  I think that's a real edge case, and probably not how most
> use MPI.  I've used both threads and MPI; MPI, while cumbersome, never
> gave me any hard-to-debug deadlock problems.
> --
> Aaron Denney
> -><-
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe

Bruce Eckel

More information about the Haskell-Cafe mailing list