From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id VAA05555 for caml-red; Wed, 29 Nov 2000 21:51:55 +0100 (MET) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id CAA09229 for ; Wed, 29 Nov 2000 02:36:02 +0100 (MET) Received: from moutvdom01.kundenserver.de (moutvdom01.kundenserver.de [195.20.224.200]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id eAT1a1r24567 for ; Wed, 29 Nov 2000 02:36:01 +0100 (MET) Received: from [195.20.224.219] (helo=mrvdom03.kundenserver.de) by moutvdom01.kundenserver.de with esmtp (Exim 2.12 #2) id 140wA7-00042H-00; Wed, 29 Nov 2000 02:35:55 +0100 Received: from drms-3e364b89.pool.mediaways.net ([62.54.75.137] helo=ice.gerd-stolpmann.de) by mrvdom03.kundenserver.de with esmtp (Exim 2.12 #2) id 140wA6-0001Sl-00; Wed, 29 Nov 2000 02:35:54 +0100 Received: from localhost (localhost [[UNIX: localhost]]) by ice.gerd-stolpmann.de (8.9.3/8.9.3) id CAA02197; Wed, 29 Nov 2000 02:35:47 +0100 From: Gerd Stolpmann Reply-To: gerd@gerd-stolpmann.de Organization: privat To: Ken Wakita , jserot@lasmea.univ-bpclermont.fr Subject: Re: Marshaling of custom blocks and threads Date: Wed, 29 Nov 2000 02:22:26 +0100 X-Mailer: KMail [version 1.0.28] Content-Type: text/plain Cc: caml-list@inria.fr References: <14882.23649.834222.868215@mistral.univ-bpclermont.fr> <20001128195826I.wakita@is.titech.ac.jp> In-Reply-To: <20001128195826I.wakita@is.titech.ac.jp> MIME-Version: 1.0 Message-Id: <00112902354700.00625@ice> Content-Transfer-Encoding: 8bit Sender: weis@pauillac.inria.fr 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 ----------------------------------------------------------------------------