Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Gerd Stolpmann <info@gerd-stolpmann.de>
To: Martin Berger <M.Berger@doc.ic.ac.uk>
Cc: caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] Re: Where's my non-classical shared memory	concurrency technology?
Date: Wed, 21 May 2008 15:50:34 +0200	[thread overview]
Message-ID: <1211377834.16959.20.camel@flake.lan.gerd-stolpmann.de> (raw)
In-Reply-To: <4833D7E8.8060502@doc.ic.ac.uk>


Am Mittwoch, den 21.05.2008, 09:06 +0100 schrieb Martin Berger:
> 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.

But this is still academic, right? The practice is that there is almost
no utility that helps programmers to write (more) correct code.

> 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.

Of course, it is possible to e.g. develop locking mechanism in event
handling programs, and then to run into the same problems. My experience
is different, however. The worst thing I've encountered so far in
practice is the "forgotten continuation" so that the event system
freezes. 

Another result from using this is in practice is that it is
comparatively easy to debug synchronization problems, because the
debugging code is not itself concurrent code. This is different to e.g.
multi-threaded programs where the whole program is concurrent, and you
cannot locally escape from this environment.

> > 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.

Granted, "cannot run into deadlocks" is too strong.

> > 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.

Well, it's probably one of the biggest programs that has ever been coded
in O'Caml... It's a search engine (wink.com), and I would say it is very
demanding in terms of concurrency.

Keep in mind that I am not a researcher. When I make statements, then
from a practical point of view. My observation is simply that you run
far quicker into complicated synchronization problems with shared memory
concurrency than with the types of concurrency I prefer.

Gerd
-- 
------------------------------------------------------------
Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany 
gerd@gerd-stolpmann.de          http://www.gerd-stolpmann.de
Phone: +49-6151-153855                  Fax: +49-6151-997714
------------------------------------------------------------



  reply	other threads:[~2008-05-21 13:49 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-18  8:39 Berke Durak
2008-05-18 16:35 ` Jon Harrop
2008-05-19 11:45   ` [Caml-list] " Martin Berger
2008-05-19 12:24     ` Berke Durak
2008-05-19 21:47       ` Jon Harrop
2008-05-19 22:24         ` Berke Durak
2008-05-19 22:37           ` Raoul Duke
2008-05-20  0:04             ` Pierre-Evariste Dagand
2008-05-20 21:27           ` David Teller
2008-05-21  7:52             ` Martin Berger
2008-05-21  8:06       ` Martin Berger
2008-05-19 14:09     ` Gerd Stolpmann
2008-05-19 16:30       ` Richard Jones
2008-05-19 18:26       ` Jon Harrop
2008-05-20  7:40       ` Ulf Wiger (TN/EAB)
2008-05-21  8:18         ` Martin Berger
2008-05-21  8:06       ` Martin Berger
2008-05-21 13:50         ` Gerd Stolpmann [this message]
2008-05-26 15:29         ` Damien Doligez
2008-05-26 16:08           ` Jon Harrop
2008-05-27  9:34           ` Martin Berger
2008-05-28 11:18             ` Damien Doligez
2008-05-28 12:16               ` Jon Harrop
2008-05-28 17:41               ` Martin Berger
2008-05-29 12:02               ` Frédéric Gava

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1211377834.16959.20.camel@flake.lan.gerd-stolpmann.de \
    --to=info@gerd-stolpmann.de \
    --cc=M.Berger@doc.ic.ac.uk \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox