caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Mattias Waldau" <mattias.waldau@abc.se>
To: <gerd@gerd-stolpmann.de>, "Ken Wakita" <wakita@is.titech.ac.jp>,
	<jserot@lasmea.univ-bpclermont.fr>
Cc: <caml-list@inria.fr>
Subject: RE: Marshaling of custom blocks and threads
Date: Wed, 29 Nov 2000 22:37:42 +0100	[thread overview]
Message-ID: <HDEEKOMJILGEIHIMAPCDKECEDLAA.mattias.waldau@abc.se> (raw)
In-Reply-To: <00112902354700.00625@ice>

The easiest way to find threading bugs are to use a multiprocessor machine.

Threading errors occurs a million times more often on a two-processor
machine than on an ordinary.

Why? Modern OS:s actually abort a thread rather seldom, and each thread is
allowed to run thousands of operations until task-switch. The chance that
this task-switch will occur at the wrong location is very small.

/mattias

-----Original Message-----
From: Pierre.Weis@inria.fr [mailto:Pierre.Weis@inria.fr]On Behalf Of
Gerd Stolpmann
Sent: Wednesday, November 29, 2000 2:22 AM
To: Ken Wakita; jserot@lasmea.univ-bpclermont.fr
Cc: caml-list@inria.fr
Subject: Re: Marshaling of custom blocks and threads


On Tue, 28 Nov 2000, Ken Wakita wrote:
>I think the Marshal module is thread unsafe because it uses a shared
>buffer to produce the external image of the ML objects.

In 2.04, this was definitely true
(see http://caml.inria.fr/bin/caml-bugs/fixed?id=24;page=1;user=guest
and http://caml.inria.fr/bin/caml-bugs/fixed?id=25page=1;user=guest).
However, the bug was still subtle; the shared buffers were relatively
well protected by the so-called "master lock". Until now, I thought
that 3.00 fixed the bug finally; i.e. the master lock really locked
the shared buffer. (I checked the code.)

Jocelyn Serot reports that Marshal is not thread-safe for custom blocks.
These did not exist in 2.04, so I suppose that only the new parts of the
marshalling system do not work properly enough. However, multi-threading
programming is error-prone, so it would be helpful to have a small program
that
demonstrates the bug (normally it is sufficient to repeat the errorneous
piece
of code often enough (e.g. 10000 times) to reproduce the incorrect
behaviour).

Gerd
--
----------------------------------------------------------------------------
Gerd Stolpmann      Telefon: +49 6151 997705 (privat)
Viktoriastr. 100
64293 Darmstadt     EMail:   gerd@gerd-stolpmann.de
Germany
----------------------------------------------------------------------------



  reply	other threads:[~2000-11-30  7:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-11-27 13:06 Jocelyn Serot
2000-11-28 10:58 ` Ken Wakita
2000-11-29  1:22   ` Gerd Stolpmann
2000-11-29 21:37     ` Mattias Waldau [this message]
2000-11-30 17:44 ` Xavier Leroy
2000-11-29 22:34 Manuel Fahndrich

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=HDEEKOMJILGEIHIMAPCDKECEDLAA.mattias.waldau@abc.se \
    --to=mattias.waldau@abc.se \
    --cc=caml-list@inria.fr \
    --cc=gerd@gerd-stolpmann.de \
    --cc=jserot@lasmea.univ-bpclermont.fr \
    --cc=wakita@is.titech.ac.jp \
    /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).