Return-Path: Delivered-To: apmail-incubator-river-dev-archive@locus.apache.org Received: (qmail 35230 invoked from network); 1 Oct 2007 19:27:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Oct 2007 19:27:05 -0000 Received: (qmail 61211 invoked by uid 500); 1 Oct 2007 19:26:55 -0000 Delivered-To: apmail-incubator-river-dev-archive@incubator.apache.org Received: (qmail 61186 invoked by uid 500); 1 Oct 2007 19:26:55 -0000 Mailing-List: contact river-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: river-dev@incubator.apache.org Delivered-To: mailing list river-dev@incubator.apache.org Received: (qmail 61177 invoked by uid 99); 1 Oct 2007 19:26:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Oct 2007 12:26:54 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [194.217.242.91] (HELO anchor-post-33.mail.demon.net) (194.217.242.91) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Oct 2007 19:26:55 +0000 Received: from dcrdev.demon.co.uk ([80.177.118.55] helo=dredd.local) by anchor-post-33.mail.demon.net with esmtp (Exim 4.67) id 1IcQuV-000GpS-CL for river-dev@incubator.apache.org; Mon, 01 Oct 2007 19:26:33 +0000 Message-ID: <470149EA.90604@dcrdev.demon.co.uk> Date: Mon, 01 Oct 2007 20:26:34 +0100 From: Dan Creswell User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: river-dev@incubator.apache.org Subject: Re: Concurrency and River References: In-Reply-To: X-Enigmail-Version: 0.95.3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi Bill, I think your idea is an interesting one and certainly and I think the lessons learnt from Jini would be valuable in this area though I'm not sure that Jini in its current incarnation is the correct base to start from. That of course might provide us with a target to evolve towards.....or perhaps we start a side-project for this work, who knows? Bill Venners wrote: > Hi All, > > I've been observing some wailing and gnashing of teeth lately in various > programming communities around what to do about the rise of multi-core > processors. > > For example, the Python folks recently had some heated debate on Artima, > for example, about something called the Global Interpreter Lock or GIL > that in some way limits the concurrency potential of CPython. I don't > quite understand the details, but there sure seemed to be some fear that > if Python didn't make multi-threading easier, it may become less relevant. > > Brian Goetz has brought up that we may have frog-boiled ourselves into > an bad situation by adopting the model of shared state with locks in > Java. In general the shared state/locks model makes concurrent programs > difficult to reason about, but in particular this approach to > concurrency isn't composable. You can't safely combine different modules > without understanding the details of what they do with locks and how > they will interact. > That's just about the consequences of shared state with concurrent access be it using locks or transactional memory etc. And I think in general concurrency is difficult to reason about even in message based systems with shared nothing because you still have issues of failure to deal with including how that might impact message delivery. > The Pragmatic Programmers recently published a book on Erlang, which got > a lot of people taking about Erlang. Erlang uses a shared nothing model, > with message passing between "processes" managed by "actors". Processes > can be implemented as threads I assume, or can be distributed. One > interesting thing about Erlang is that it tries to unify the remote and > local models, as far as I can tell. Not that they haven't read a Note on > Distributed Computing. I think that instead of trying to make remote > nodes look like local ones, they may treat local ones as unreliable as > remote ones. > I've yet to see exactly how Erlang does failure detection of processes. I guess there might be some timeout value somewhere in respect of messages reaching a destination etc but I've not seen a description of this aspect of Erlang. Further whilst Erlang might do failure detection (of a form) solving the issues of failure are the difficult bit and I'm less convinced Erlang offers much here. For example, one solution to failure is replication and it appears you are (unsurprisingly) left to do that for yourself right now. Putting my high-performance hat on I'd also point out that replication has recognized limits especially when it's done with transactions which leads to even more esoteric solutions that are largely about appropriate architecture/interactions and less about shared-nothing or message passing. > I've been involved with a language called Scala lately, which has an > Erlang-like actors library. On the mailing list they keep talking about > issues with implementing remote actors. I as yet don't understand these > details either, but I keep getting this wierd feeling that wheel > reinvention is going on. They seem to be talking about how to solve > problems that Jini addressed almost 10 years ago. > > So here's my question. I get the feeling that the trend to multi-core > architectures represents a disruptive technology shift that will shake > up the software industry to some extent. Does River have something to > offer here? If you expect the chips your software will run on will have > multiple cores, and maybe you don't know how many until your program > starts running, you'll want to organize your software so it distributes > processing across those cores dynamically. Isn't JavaSpaces a good way > to do that? > > I think what it might mean is that you treat another core on the same > box running a worker thread the same as a worker thread across the > network. That way you have a uniform programming model, and when you run > out of cores, you just add more boxes and you get more worker nodes. So > it would be the opposite of the concept targeted by the Note. Yes, you > would use objects through a uniform interface, and whether or not that > object is implemented locally or remotely would be an implementation > detail of the object. But what you'd assume is not that the thing is > local (a thread on another core of the same box) but remote. > Hmmmm, so the uniform model concept is nice and cleans out one difficulty but there are some others lying around in this which I reckon are in need of consideration: (1) A number of multi-core systems are threatening to head towards NUMA type architectures where the cost of comms is in part related to the number of memory spaces you have to hop. (2) There's at least some (significant?) difference between comms performance across processors in the same box versus across a network and therefore the protocols you design and what you pass around in messages might be somewhat different. > Anyway, I was curious what everyone here thought. It may be a way to > position River in people's minds, give it a marketing story. > Very best, Dan.