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

2008-09-12 Thread Robert Greayer
--- On Fri, 9/12/08, Bruce Eckel [EMAIL PROTECTED] wrote:

 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.
 

As I believe it is the case that you can emulate shared resources, and locks to 
control concurrent access to them, using the actor model, I can't see how this 
can be true.

rcg



  
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


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

2008-09-12 Thread Bruce Eckel
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 [EMAIL PROTECTED] wrote:
 On 2008-09-10, David Roundy [EMAIL PROTECTED] 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@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe




-- 
Bruce Eckel
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


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

2008-09-12 Thread Sebastian Sylvan
On Fri, Sep 12, 2008 at 4:07 PM, Bruce Eckel [EMAIL PROTECTED] wrote:

 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.


I think you need to specify what you mean by actors, because I can't see how
they would eliminate deadlocks as I understand them. Could you not write an
actor that holds a single cell mailbox (both reads and writes are blocking),
then set up two classes that shuffles values from the same two mailboxes in
the opposite direction?

-- 
Sebastian Sylvan
+44(0)7857-300802
UIN: 44640862
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe