[Mono-dev] asynchronous exceptions

Konstantin Triger kostat at gmail.com
Wed Jun 18 07:30:18 EDT 2008

Hello Bastian,

Eventually I would ask what kind of abortion you need "soft" or "hard".

Hard abortion means that it will happen regardless of what the thread is
doing and can be achieved using Thread.Abort(). It's considered unsafe since
it can lead to resource leaks. Note, that "hard" abort is inherently
unsafe regardless of the platform you use (clr,java,native or whatever)
until you restrict the program possibilities.

 Soft abortion means that in some "control points" the thread itself checks
for some condition and if it's not fullfilled "soft" aborts itself by
throwing an exception (for example). This kind of abortion is safe since the
thread controls in which points the condition is checked. In the same time
if the thread does not reach the control point, it won't be aborted.

You may consider "hard", "soft" abortion or a combination of them (e.g. soft
and later hard after some timeout). For "control points" you may consider
using aspect oriented techniques.

Hope this helps,

2008/6/18 Bastian Schmitz <bastian.schmitz at udo.edu>:

> Hello list.
> Within the scope of my diploma thesis, I am going to create a (or extend an
> existing) programming language (+compiler) for the control of automated
> vehicles. Right now I am evaluating the use of mono as a runtime platform.
> I am planning to have a language element, which ensures that a given
> condition
> stays fulfilled during the execution of block of code. If the condition is
> violated an exception should be risen. The condition is (probably) going to
> be checked/evaluated by another thread, who should inform the first one in
> case of violation of the condition.
> This pattern resembles to the asynchronous exception used by the
> Thread.Abort() method being triggered by an external thread, catching the
> ThreadAbortException and canceling the abort afterwards.
> I am wondering if there is a safe way to achieve this functionality with
> the
> crl/mono runtime.
> Best regards,
> Bastian Schmitz
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list

Konstantin Triger
RSS: http://feeds.feedburner.com/ktriger
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20080618/ebad6fdb/attachment-0001.html 

More information about the Mono-devel-list mailing list