English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Re: [Caml-list] The closing gap (warning: long, inflammatory rant)
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-04-21 (21:16)
From: Berke Durak <berke.durak@g...>
Subject: Re: [Caml-list] The closing gap (warning: long, inflammatory rant)
Richard Jones:
> Garbage collectors and _not_ using threads both improve the safety of the

Arnaud Spiwack:

> This might depend on what kind of thread interface you are provided with.
> Of course it's never easy to work with non-determinism, but if I take jocaml
> for instance, which gives you a process (in the sense of pi-calculus)
> interface to threads, and it makes it probably rather safe actually,
> possibly stronger safety when dealing with multiple processes (or UI threads
> possibly) than doing things with low-level primitves like fork and such.

That's the point.  The conventional threading model (mutable shared data and
mutexland) is unsafe by default.  It's like the good old days of manual
memory management in C, except
that you replace malloc/free with pthread_mutex_lock/pthread_mutex_unlock
signal 11 by deadlocks.

But it's actually worse because mutexing doesn't compose as well as malloc.
This means that it's difficult to increase the abstraction level.