Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Where's my non-classical shared memory concurrency technology?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-05-21 (08:06)
From: Martin Berger <M.Berger@d...>
Subject: Re: [Caml-list] Re: Where's my non-classical shared memory concurrency technology?
Gerd Stolpmann wrote:

> I cannot agree. Just use Ocamlnet! Or other libraries doing it for you.

OK I was speaking carelessly. Of course one can use libraries for
e.g. event-handling.

> On the contrary: Shared memory parallelization has the fundamental
> disadvantage that you cannot reason about it, and so the only way of
> checking the quality of the code is testing. 

Here I disagree. Shared  memory concurrency is a specific form
of message passing: Writing to a memory cell is in fact sending
a message to that cell carrying two items, the new value and a
return channel that is used to inform the writer that sending
has succeeded, and likewise for reading. This way of thinking
about shared memory concurrency has enabled the construction of
powerful logics and typing systems to reason about shared memory.

I agree with the spirit of your claim though: shared memory is
a form of message passing that is especially difficult.

> With "reasoning" I don't necessarily mean formal techniques. The more
> frequent case is that the programmer thinks about the program guided by
> the laws of logic.
> The impossibility to do this with truly parallelized code is an
> important source of bugs, so I would say this code inherently more
> buggy.

There is a lot of truth in what you say, but if you consider complex
event handling programs, you essentially do concurrent programming,
wether you like it or not. You just don't call it by that name.

> This is simply nonsense. Different concurrency techniques have different
> problems. For example, in event handling-based concurrency you do not
> need locks, hence you cannot run into deadlocks.

I disagree, but as the issue has already been dealt with by other
posters, I shall leave it at that.

> Maybe in a mainstream language, but in FP I found it always relatively
> easy to do it.

Maybe you are an especially skilled programmer. Or maybe the applications
that you have coded are not demanding in terms of concurrency.