swarm-modeling
[Top][All Lists]
Advanced

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

Re: Concurrency


From: Philippe LAVAL
Subject: Re: Concurrency
Date: Mon, 12 May 1997 10:22:46 -0100

Nelson Minar said:
> Basically, it's pretty cool to have synchronization built right into the
language. 

You seem to arrive to a reasonable approach to concurrency. Of course, 
Swarm ought to be programmed in a language with built-in concurrency
(a language designed with concurrency in mind from its very basis, not
as an afterthought). Only one fulfills these conditions: Ada (Java is a
special web-oriented small language, which has borrowed some Ada
constructs).

What is called concurrent programming is, most of the time, only the
extension of sequential languages with constructs permitting to take
advantage of data parallelism, on a multiprocessor system. This is a 
special case, only useful when the data present a regular pattern 
(as in image analysis, or for numerical simulations). See Ian Foster's
book (Designing and building parallel programs. Addison-Wesley, 1995).
This book has examples using the PVM, PARMACS, Compositional C++, 
FORTRAN  M, HPF, and MPI extensions.

What is more fundamental (but foreign to these extensions, which are
kinds of prostheses) is the notion of *logical* parallelism, where
processes which are logically concurrent in the application are
programmed with independent code modules communicating asynchronously
(these modules may be mapped to operating system threads by the compiler).

A logically concurrent program may execute on a monoprocessor (with of
course no increase in speed,  but with a large gain in clarity, ease
of understanding and evolution of the code). Ada allows logical
concurrency; moreover,  the _same_ code may run on a multiprocessor, this
time benefiting from the speed increase. There is also a *standardized*
distributed programming annex (optional) in Ada 95 compilers.

Contrary to Ada 83, which was only object-based, the new Ada 95 is fully
object-oriented (but inheritance has been most of the time abused by  C++ 
or Objective C programmers, which mainly regard it as a mean to write less
code).
Cases where inheritance comes naturally, because it is in the logic of the
application,
are relatively rare.

Last but not least: Ada code may automatically be converted to Java
applets (but not the other way).

For more information on Ada, including a C/C++ comparison, a tutorial
for C++ programmers, Ada and Java, how to download a free GNU Ada compiler, 
a list of books, see http://www.adahome.com/


--------------------------------------------------------------------
Philippe Laval
Station zoologique
B.P. 28 - 06234 Villefranche-sur-Mer CEDEX (France)
address@hidden


                  ==================================
   Swarm-Modelling is for discussion of Simulation and Modelling techniques
   esp. using Swarm.  For list administration needs (esp. [un]subscribing),
   please send a message to <address@hidden> with "help" in the
   body of the message.
                  ==================================


reply via email to

[Prev in Thread] Current Thread [Next in Thread]