[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OO vs. CSP - Papers, Arguments?

Quoting Koehne Kai <Kai.Koehne@xxxxxxxxxxxxxxxxxxxxxxxxxx>:
> What are the main advantages/disadvantages of the CSP approach
> in contrast to concurrent object oriented aproaches?

IMHO, the primary advantage is that CSP-based concurrency provides robust
compositionality based on a solid theoretical underpinning that permits design
analysis. What I mean by that is the CSP allows individual processes to be
understood in isolation, and composed into larger processes in a way that
produces behavior that is readily predictable using algebraic reasoning.

As Peter pointed out in the presentation you referenced, thread-based and
monitor-based approaches are not compositional (entity behavior becomes shared
among objects), and are not anywhere near as easy to reason about. There's
brief discussion of these problems in Peter's infamous "Wot no Chickens?" email
at http://wotug.ukc.ac.uk/parallel/groups/wotug/java/discussion/3

Note that OO and CSP are not mutually exclusive: the primary example is Peter's
implementation of JCSP, which provides CSP concurrency semantics in the context
of Java's OO system (you might look at
http://www-128.ibm.com/developerworks/java/library/j-csp1.html for a reasonably
concise explanation of JCSP and how it compares to java.util.concurrent). Of
course, it'd be nice if Java easily supported syntax extensions (ala Lisp or
OCaml), so that using JCSP could be made to feel like a native part of the
language. But that's another story...

Allan McInnes <amcinnes@xxxxxxxxxx>
PhD Candidate
Dept. of Electrical and Computer Engineering
Utah State University