caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Gordon Henriksen <gordonhenriksen@mac.com>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Has the thread cancellation problem evolved ?
Date: Tue, 28 Aug 2007 10:23:43 -0400	[thread overview]
Message-ID: <5EB9CEB2-3B79-4652-B6D1-10FEEC8E55E5@mac.com> (raw)
In-Reply-To: <BF8C1117-83A3-46AA-82C4-EC9D96E51F69@epfl.ch>

On Aug 28, 2007, at 05:26, Daniel Bünzli wrote:

> Le 28 août 07 à 01:33, Gerd Stolpmann a écrit :
>
>> Nevertheless, I don't think this is a good thing. Raising an  
>> exception at potentially any moment is a problematic thing. E.g.  
>> code like
>>
>> let x = try Some(List.assoc ... with _) -> None
>>
>> where the author implicitly assumes that it is only Not_found that  
>> can happen and the code is just plain wrong if anything else is  
>> encoded into the exception.
>
> But this is sloppy programming anyway. The author is plain wrong in  
> assuming that only Not_found can be raised, he is asking for a  
> potential time consuming debugging session.

Such problems are too common to ignore. .NET defuses them by treating  
ThreadAbortException specially.

“When a call is made to the Abort method to destroy a thread, the  
common language runtime throws a ThreadAbortException.  
ThreadAbortException is a special exception that can be caught, but  
it will automatically be raised again at the end of the catch block.  
When this exception is raised, the runtime executes all the finally  
blocks before ending the thread. Since the thread can do an unbounded  
computation in the finally blocks, or call Thread.ResetAbort to  
cancel the abort, there is no guarantee that the thread will ever end.”

http://msdn2.microsoft.com/en-us/library/ 
system.threading.threadabortexception.aspx

— Gordon


  parent reply	other threads:[~2007-08-28 14:24 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-25 13:58 Daniel Bünzli
2007-08-25 15:29 ` [Caml-list] " skaller
2007-08-26 23:47   ` Daniel Bünzli
2007-08-27  0:18     ` Till Varoquaux
2007-08-27  4:38     ` skaller
2007-08-27 10:12       ` Daniel Bünzli
2007-08-27 11:28         ` skaller
2007-08-27 11:49           ` Jon Harrop
2007-08-27 12:24           ` Daniel Bünzli
2007-08-27 12:38             ` Jon Harrop
2007-08-27 13:09               ` Daniel Bünzli
2007-08-27 14:27               ` skaller
2007-08-27  7:55     ` Markus E L
2007-08-27 23:33   ` Gerd Stolpmann
2007-08-28  9:26     ` Daniel Bünzli
2007-08-28 11:42       ` Gerd Stolpmann
2007-08-28 14:46         ` Daniel Bünzli
2007-08-28 14:23       ` Gordon Henriksen [this message]
2007-08-28 14:35         ` Brian Hurt
2007-08-28 14:44           ` Daniel Bünzli
2007-08-28 14:54           ` Robert Fischer
2007-08-28 15:12             ` Brian Hurt
2007-08-28 15:32               ` Gordon Henriksen
2007-08-28 15:40               ` skaller
2007-08-29  8:12               ` Lionel Elie Mamane
2007-08-28 15:00           ` Gordon Henriksen
2007-08-25 15:44 ` skaller
2007-08-26 23:24   ` Alain Frisch
2007-08-25 15:57 ` Gordon Henriksen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5EB9CEB2-3B79-4652-B6D1-10FEEC8E55E5@mac.com \
    --to=gordonhenriksen@mac.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).