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: -- (:)
From: Gerd Stolpmann <info@g...>
Subject: Re: [Caml-list] Re: Where's my non-classical shared memory concurrency technology?

Am Montag, den 19.05.2008, 12:45 +0100 schrieb Martin Berger:
> Jon Harrop wrote:
> >> Similarly, avoiding threads removes concurrency bugs...
> > I don't believe you have removed any concurrency bugs. I think you just pushed 
> > them around a bit.
> I couldn't agree more. If you 'avoid' concurrency by writing your own
> 'sequential' event handling code, you have not removed the concurrency,
> you just face it in a slightly different form, and you have to
> program the event handling code yourself, 

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

> rather than relying
> on a tried and tested library, 

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. Event handing concurrency,
while not giving you parallelization, is basically sequential
programming, and it is possible to reason about such programs.

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

> i.e. you have an additional
> source of bugs, without removing the problems that are inherent
> in concurrency (e.g. deadlocks, livelocks, fairness ...).

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.

>  There
> are reasons why writing your own concurrency mechanisms might
> be the way to go, but it's a highly non-trivial endeavor.

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

> Concurrency is hard, and no matter how one presents the concurrency
> (message passing, shared memory, event handling etc), the fundamental
> problems will always be there.

As pointed out, I cannot agree with your premises. There are different
types of concurrency built on top of different fundaments.


> > Data parallelism in Microsoft's Task Parallel Library. I have no 
> > use for STM  myself.
> Do you have industrial experience with STM? I wonder how it
> performs in industrial settings. Reading STM papers by their
> inventors makes them sound like the best thing since sliced
> bread, but I have a (probably irrational) feeling that it's
> difficult to beat fine grained locking if one can handle
> the programming difficulties their use imposes.
> Martin Berger
> _______________________________________________
> Caml-list mailing list. Subscription management:
> Archives:
> Beginner's list:
> Bug reports:
Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany
Phone: +49-6151-153855                  Fax: +49-6151-997714