dotgnu-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [DotGNU]Safely implementing Thread.Abort


From: Rhys Weatherley
Subject: Re: [DotGNU]Safely implementing Thread.Abort
Date: Thu, 20 May 2004 07:36:10 +1000
User-agent: KMail/1.4.3

On Thursday 20 May 2004 06:58 am, Thong (Tum) Nguyen wrote:

> I think this could work...what do you guys think?

You cannot use any approach that requires the method code to be modified after 
it is first generated.  It isn't thread safe: what if another thread is 
executing the method while you are modifying it?  It isn't even thread-safe 
for the thread that you are suspending: if it is suspended while the thread 
was in the middle of executing the NOP, then it will be in an unknown state 
when resumed.

Outputting abort check instructions on every backward branch is OK with me, as 
long as you only do it in programs that use Thread.Abort.  This can be 
detected by the loader (any assembly with a MemberRef to Thread.Abort is a 
candidate).

Cheers,

Rhys.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]