Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Has the thread cancellation problem evolved ?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-08-27 (12:00)
From: Jon Harrop <jon@f...>
Subject: Re: [Caml-list] Has the thread cancellation problem evolved ?
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