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 concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 7A1C9BC6B for ; Tue, 28 Aug 2007 17:40:49 +0200 (CEST) Received: from ipmail03.adl2.internode.on.net (ipmail03.adl2.internode.on.net [203.16.214.135]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l7SFelwx026034 for ; Tue, 28 Aug 2007 17:40:48 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAL/d00Y7pw2h/2dsb2JhbAAM X-IronPort-AV: E=Sophos;i="4.19,317,1183300200"; d="scan'208";a="139186307" Received: from ppp59-167-13-161.lns2.syd7.internode.on.net (HELO [192.168.1.201]) ([59.167.13.161]) by ipmail03.adl2.internode.on.net with ESMTP; 29 Aug 2007 01:10:43 +0930 Subject: Re: [Caml-list] Has the thread cancellation problem evolved ? From: skaller To: Brian Hurt Cc: Robert Fischer , caml-list@inria.fr In-Reply-To: <46D43B68.1000206@janestcapital.com> References: <9FA25C33-04DD-46BD-8959-873DDD2FFF82@epfl.ch> <1188055755.10796.37.camel@rosella.wigram> <1188257636.7533.23.camel@localhost.localdomain> <5EB9CEB2-3B79-4652-B6D1-10FEEC8E55E5@mac.com> <46D432CA.8010708@janestcapital.com> <46D4370C.1000305@fischerventure.com> <46D43B68.1000206@janestcapital.com> Content-Type: text/plain Date: Wed, 29 Aug 2007 01:40:41 +1000 Message-Id: <1188315641.5950.9.camel@rosella.wigram> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 46D441FF.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 dated:98 signaling:98 signaling:98 sourceforge:01 wrote:01 wrote:01 stack:01 rec:01 rec:01 exception:01 exception:01 caml-list:01 expression:02 behaves:02 On Tue, 2007-08-28 at 11:12 -0400, Brian Hurt wrote: > Robert Fischer wrote: > > > Brian Hurt wrote: > > > >> So what happens if I throw an infinite loop into an exception handler? > > > > Now, my experience with .Net is somewhat dated, but I'm pretty sure it > > re-hangs on your loop, and signaling another abort will break out of > > your loop and continue up the chain of exception handlers. At least > > once upon a time, there was a very large business which I worked for > > that did a lot of concurrent .Net work, and the standard solution was > > to keep signaling the abort until the thing finally died. > > > > ~~ Robert. > > > > > Until you get someone "clever", who does something like (in Ocaml): > > let rec do_my_work () = > try > do_a_bunch_of_work () > with > | Thread_abort_exception -> > (* Ack! Someone tried to kill me! I refuse to die! *) > do_my_work () > ;; > > I suppose eventually you'd blow stack. > > Then, there's the what-if: > > let rec example () = > try > do_a_bunch_of_work () > with > | Thread_abort_exception -> > raise (Invalid_arg "Ack! They got me!") > ;; > > i.e. what happens if my catch expression raises another (different) > exception? > > Not to mention the fact that this solution requires a rather intrusive > change to the run time, and a special exception which behaves > differently from every other exception. That's when you have "ThreadReallyAbort" exception .. :)) -- John Skaller Felix, successor to C++: http://felix.sf.net