From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id RAA03874 for caml-redistribution; Thu, 13 Jan 2000 17:29:35 +0100 (MET) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id KAA31539 for ; Thu, 13 Jan 2000 10:32:49 +0100 (MET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.8.7/8.8.7) with ESMTP id KAA19492; Thu, 13 Jan 2000 10:32:42 +0100 (MET) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA07318; Thu, 13 Jan 2000 10:32:40 +0100 (MET) Message-ID: <20000113103240.36062@pauillac.inria.fr> Date: Thu, 13 Jan 2000 10:32:40 +0100 From: Xavier Leroy To: David McClain , caml-list@inria.fr Subject: Re: Threads Library References: <000c01bf51e0$ef8295a0$250148bf@vega> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.89.1 In-Reply-To: <000c01bf51e0$ef8295a0$250148bf@vega>; from David McClain on Wed, Dec 29, 1999 at 02:41:49AM -0700 Sender: weis > However, unlike CML, (on Windows/NT at least) the GC does not discard > threads hung up on channels that are no longer in use by active threads. > Hence the use of speculative spawning is not safe in WinNT/OCAML. (Early > experiments generated thousands of threads before I had to kill off the > program). This is correct. Currently, there is no automatic reclaimation of threads whose identifier (the associated Thread.t value) is unreachable, because those threads could be "daemon" threads that do useful work in the background. > Secondly, it would appear that the semantics of "with_abort" require that > the wrapper function be called ahead of all "with" functions. But > experiments where a with-function raises an exception bypass the actions of > pending "with_abort" functions on non-selected channels. So evidently, one > should not permit the use of uncaught exceptions inside of "with" functions. > > Finally, where Reppy's CML uses continuations to effect tail calls, I wonder > about the use of indefinite recursion triggered by a with-function. It would > seem that one should treat composite event lists in much the same manner as > "try-with" when it comes to recursion inside a try (resp. with) clause. > Instead of tail calling from the "with" clause one should return a value to > the outer level of the "sync" or "select", and then "match" on that value > before recursing. I haven't read Reppy's book yet, so I'm not absolutely sure I follow you here, but generally speaking it is true that the "with_abort" mechanism is more heavyweight in OCaml than in CML, because it is implemented with "real" threads in OCaml while CML uses a much more lightweight callcc-based implementation. - Xavier Leroy