Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
From: Gordon Henriksen <gordonhenriksen@m...>
Subject: Re: [Caml-list] Has the thread cancellation problem evolved ?
On Aug 28, 2007, at 10:35, Brian Hurt wrote:

> Gordon Henriksen wrote:
>
>> 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
>
> So what happens if I throw an infinite loop into an exception handler?

Such would fall into the category of “unbounded computation” in the  
quoted passage.

— Gordon