caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Gerd Stolpmann <info@gerd-stolpmann.de>
To: Martin Berger <M.Berger@doc.ic.ac.uk>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Re: Where's my non-classical shared memory concurrency technology?
Date: Mon, 19 May 2008 16:09:04 +0200	[thread overview]
Message-ID: <1211206144.11053.15.camel@flake.lan.gerd-stolpmann.de> (raw)
In-Reply-To: <4831686F.8010903@doc.ic.ac.uk>


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

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

Gerd

> 
> > 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:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
> 
-- 
------------------------------------------------------------
Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany 
gerd@gerd-stolpmann.de          http://www.gerd-stolpmann.de
Phone: +49-6151-153855                  Fax: +49-6151-997714
------------------------------------------------------------



  parent reply	other threads:[~2008-05-19 14:07 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 [this message]
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
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=1211206144.11053.15.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;
as well as URLs for NNTP newsgroup(s).