From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id D74C9BC6B for ; Mon, 27 Aug 2007 14:00:27 +0200 (CEST) Received: from pih-relay06.plus.net (pih-relay06.plus.net [212.159.14.133]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l7RC0RUm012331 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Mon, 27 Aug 2007 14:00:27 +0200 Received: from [80.229.56.224] (helo=beast.local) by pih-relay06.plus.net with esmtp (Exim) id 1IPdGc-0006m5-TF for caml-list@yquem.inria.fr; Mon, 27 Aug 2007 13:00:27 +0100 From: Jon Harrop Organization: Flying Frog Consultancy Ltd. To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Has the thread cancellation problem evolved ? Date: Mon, 27 Aug 2007 12:49:30 +0100 User-Agent: KMail/1.9.7 References: <9FA25C33-04DD-46BD-8959-873DDD2FFF82@epfl.ch> <1188214119.13927.16.camel@rosella.wigram> In-Reply-To: <1188214119.13927.16.camel@rosella.wigram> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200708271249.30674.jon@ffconsultancy.com> X-Miltered: at discorde with ID 46D2BCDB.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; constructors:01 pointers:01 ocaml:01 ocaml:01 frog:98 wrote:01 executes:01 exception:01 caml-list:01 rarely:02 objects:02 problem:05 thread:06 destructors:07 destructors:07 On Monday 27 August 2007 12:28:39 skaller wrote: > In C++, RAIII is used for this, i.e. object whose constructors > acquire a resource and destructors release it, together with > say ref counted pointers, so that throwing an exception unwinds > all the objects, i.e. executes the destructors to release the > resources. > > Ocaml has no such facility... Sounds like you want an OCaml equivalent of .NET's Dispose. That's very easy to achieve in OCaml but it is rarely useful. -- Dr Jon D Harrop, Flying Frog Consultancy Ltd. OCaml for Scientists http://www.ffconsultancy.com/products/ocaml_for_scientists/?e