[Mono-dev] (Nevermind) Asp.net thread abort issue

Kornél Pál kornelpal at hotmail.com
Sun Oct 9 08:49:30 EDT 2005


Hi,

This has no connection with TargetInvocationException. A thread is aborted
using an exception when the exception reaches the top of the stack the
thread will be aborted. ThreadAbortException is a special one as it will be
rethrown even when you caught it unless you called Thread.ResetAbort(). Note
that however that ThreadAbortException will not be rethrown if there is
another exception on the stack as in this case that exception can reach the
top of the stack and the thread will be aborted. In addition this gives you
the ability to catch that exception and handle it rather than being lost by
replacing it with a ThreadAbortException. In the case you mentioned this
exception is TargetInvocationException but it could be any other exception
as well.

Kornél

----- Original Message -----
From: "Matthijs ter Woord" <matthijsterwoord at gmail.com>
To: "Joshua Tauberer" <tauberer at for.net>
Cc: <mono-devel-list at lists.ximian.com>
Sent: Sunday, October 09, 2005 2:10 PM
Subject: Re: [Mono-dev] (Nevermind) Asp.net thread abort issue


> IMHO, TargetInvocationException is raised for EVERY exception raised by
> the
> Invoke() 'd method.
>
>
>
> ----- Original Message -----
> From: "Joshua Tauberer" <tauberer at for.net>
> Cc: <mono-devel-list at lists.ximian.com>
> Sent: Sunday, October 09, 2005 2:04 PM
> Subject: Re: [Mono-dev] (Nevermind) Asp.net thread abort issue
>
>
>> Gonzalo Paniagua Javier wrote:
>>   > Anyway, if you ever decide to catch ThreadAbortException anywhere in
> the
>> > asp.net pipeline, bear in mind that it's used also when the configured
>> > timeout is reached.
>>
>> The timeout for what?
>>
>> This ThreadAbortException business is quite something to get a handle
>> on.  For instance, if you abort the thread within a method called by
>> reflection, when Invoke() finishes the exception is a
>> TargetInvocationException and not a ThreadAbortException, confusing my
>> catch clauses higher up.  Is that the right behavior?  It also doesn't
>> do the usual automatic re-throwing of the ThreadAbortException after
>> catch clauses, so the thread goes on if the exception is caught at any
>> point.
>>
>> --
>> - Joshua Tauberer
>>
>> http://taubz.for.net
>>
>> ** Nothing Unreal Exists **
>>
>>
>> _______________________________________________
>> Mono-devel-list mailing list
>> Mono-devel-list at lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>




More information about the Mono-devel-list mailing list