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

2008-09-12 Thread Albert Y. C. Lai
Sebastian Sylvan wrote: For correctness, maybe not, for efficiency, yes definitely! In theory, decades of research and engineering went into shared memory on common hardware, so it should be faster. In practice, you give shared memory to spoiled kids (and seldom encourage them to use other

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

2008-09-10 Thread Maarten Hazewinkel
Hi Bruce, Some comments from an 11 year Java professional and occasional Haskell hobbyist. On 9 Sep 2008, at 20:30, Bruce Eckel wrote: So this is the kind of problem I keep running into. There will seem to be consensus that you can do everything with isolated processes message passing

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

2008-09-10 Thread Sebastian Sylvan
2008/9/9 Bruce Eckel [EMAIL PROTECTED] So this is the kind of problem I keep running into. There will seem to be consensus that you can do everything with isolated processes message passing (and note here that I include Actors in this scenario even if their mechanism is more complex). And

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

2008-09-10 Thread David Roundy
2008/9/9 Jed Brown [EMAIL PROTECTED]: On Tue 2008-09-09 12:30, Bruce Eckel wrote: So this is the kind of problem I keep running into. There will seem to be consensus that you can do everything with isolated processes message passing (and note here that I include Actors in this scenario even if

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

2008-09-10 Thread Jed Brown
On Wed 2008-09-10 09:05, David Roundy wrote: 2008/9/9 Jed Brown [EMAIL PROTECTED]: On Tue 2008-09-09 12:30, Bruce Eckel wrote: So this is the kind of problem I keep running into. There will seem to be consensus that you can do everything with isolated processes message passing (and

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

2008-09-10 Thread David Roundy
On Wed, Sep 10, 2008 at 03:30:50PM +0200, Jed Brown wrote: On Wed 2008-09-10 09:05, David Roundy wrote: 2008/9/9 Jed Brown [EMAIL PROTECTED]: On Tue 2008-09-09 12:30, Bruce Eckel wrote: So this is the kind of problem I keep running into. There will seem to be consensus that you can do

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

2008-09-10 Thread Ryan Ingram
On Wed, Sep 10, 2008 at 2:55 AM, Maarten Hazewinkel [EMAIL PROTECTED] wrote: And a further note on sharing memory via a transactional resource (be it STM, a database or a single controlling thread). This situation always introduces the possibility that your update fails, and a lot of client

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

2008-09-10 Thread Maarten Hazewinkel
On 10 Sep 2008, at 20:28, Ryan Ingram wrote: On Wed, Sep 10, 2008 at 2:55 AM, Maarten Hazewinkel [EMAIL PROTECTED] wrote: [on transaction failures in databases and STM] This seems to be a bit too much F.U.D. for STM. As long as you avoid unsafeIOToSTM (which you really should; that

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

2008-09-09 Thread Sebastian Sylvan
On Mon, Sep 8, 2008 at 8:33 PM, Bruce Eckel [EMAIL PROTECTED] wrote: As some of you on this list may know, I have struggled to understand concurrency, on and off for many years, but primarily in the C++ and Java domains. As time has passed and experience has stacked up, I have become more

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

2008-09-09 Thread Bruce Eckel
So this is the kind of problem I keep running into. There will seem to be consensus that you can do everything with isolated processes message passing (and note here that I include Actors in this scenario even if their mechanism is more complex). And then someone will pipe up and say well, of

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

2008-09-09 Thread Jed Brown
On Tue 2008-09-09 12:30, Bruce Eckel wrote: So this is the kind of problem I keep running into. There will seem to be consensus that you can do everything with isolated processes message passing (and note here that I include Actors in this scenario even if their mechanism is more complex). And

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

2008-09-09 Thread Jason Dusek
Bruce Eckel [EMAIL PROTECTED] wrote: ...shared-memory concurrency is impossible for programmers to get right... Explicit locking is impractical to get right. Transactional interfaces take much of the pain out of that -- even web monkeys can get shared memory right with SQL! When two

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

2008-09-08 Thread Bruce Eckel
As some of you on this list may know, I have struggled to understand concurrency, on and off for many years, but primarily in the C++ and Java domains. As time has passed and experience has stacked up, I have become more convinced that while the world runs in parallel, we think sequentially and so

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

2008-09-08 Thread Arnar Birgisson
Hi Bruce, On Mon, Sep 8, 2008 at 21:33, Bruce Eckel [EMAIL PROTECTED] wrote: I know that both Haskell and Erlang only allow separated memory spaces with message passing between processes, and they seem to be able to solve a large range of problems -- but are there problems that they cannot

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

2008-09-08 Thread Kyle Consalus
Depending on definitions and how much we want to be concerned with distributed systems, I believe either model can be used to emulate the other (though it is harder to emulate the possible pitfalls of shared memory with CSP). To me, it seems somewhat similar to garbage collection vs manually

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

2008-09-08 Thread Timothy Goddard
On Tue, 09 Sep 2008 07:33:24 Bruce Eckel wrote: I know that both Haskell and Erlang only allow separated memory spaces with message passing between processes, and they seem to be able to solve a large range of problems -- but are there problems that they cannot solve? I recently listened to an

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

2008-09-08 Thread Brandon S. Allbery KF8NH
On 2008 Sep 8, at 21:00, Timothy Goddard wrote: I am not a mathematician, I can't prove it, but I can't think of circumstances where I would need to put mutable references in a data structure except where the language and compiler can't handle immutable structures efficiently. The status

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

2008-09-08 Thread Richard A. O'Keefe
I think the demonstration is in Hoare's book on co-operating sequential processes, but if you have pure processes and message passing, you can simulate conventional variables. Here's an Erlang version: variable_loop(State) - receive {ask,Sender} - Sender!{self(),State},

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

2008-09-08 Thread Richard A. O'Keefe
On 9 Sep 2008, at 8:15 am, Kyle Consalus wrote: Anyway, for the time being I believe there are operations that can be done with shared memory that can't be done with message passing if we make good performance a requirement. One of our people here has been working on Distributed Shared