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 F0989BC6C for ; Tue, 28 Aug 2007 17:12:41 +0200 (CEST) Received: from smtp.janestcapital.com (janestcapital.com [66.155.124.107]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l7SFCf2A017593 for ; Tue, 28 Aug 2007 17:12:41 +0200 Received: from [172.25.129.161] [38.96.172.125] by janestcapital.com with ESMTP (SMTPD-9.10) id AB8406F8; Tue, 28 Aug 2007 11:13:08 -0400 Message-ID: <46D43B68.1000206@janestcapital.com> Date: Tue, 28 Aug 2007 11:12:40 -0400 From: Brian Hurt User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Robert Fischer Cc: caml-list@inria.fr Subject: Re: [Caml-list] Has the thread cancellation problem evolved ? 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> In-Reply-To: <46D4370C.1000305@fischerventure.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 46D43B69.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 dated:98 signaling:98 signaling:98 wrote:01 wrote:01 stack:01 rec:01 rec:01 exception:01 exception:01 caml-list:01 expression:02 behaves:02 arg:03 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. Brian