Re: Safely implementing Thread.Abort

Rhys Weatherley <[email protected]>
Newsgroups gmane.comp.gnu.dotgnu.developer
Organization Southern Storm Software, Pty Ltd
Message-ID <[email protected]>
On Thursday 20 May 2004 02:58 pm, Russell Stuart wrote:

> And that assumes your signal() handler checked you were
> in the interpreter to start with, so it wouldn't leap out
> of some critical piece of code such as the GC.

There are ways of dealing with that in the JIT.  e.g. Mono sets a flag to 
indicate if the current thread is in managed or unmanaged code.  The flag is 
changed upon transitions between the two worlds.  If the flag is set to 
"unmanaged", then the signal handler won't throw immediately, but will set 
the "abort requested" flag.  Upon returning to managed code, the abort flag 
is checked.

> I am not sure if a function return would be expensive
> under the JIT, but that is the JIT authors problem.
> By all reports he is a very capable man.

That he is. :-)

Cheers,

Rhys.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.