[Mono-dev] asynchronous exceptions
Bastian Schmitz
bastian.schmitz at udo.edu
Wed Jun 18 09:25:28 EDT 2008
Hello Kosta,
thanks for your reply. I asked myself again what I really need and arrived at
the conclusion that resource leaks are not tolerable. You mentioned that a
reduction of the program's possibilities could result in safe "hard" abort.
What do I have to restrict or is this only a theoretical approach?
I suppose i'd like the program to react to certain conditions with an
exception within a (preferably bounded) short amout of time. Of course this
assumes that scheduling and garbage collection are somehow playing along.
To use "soft" aborts and control points respectively in a thread, I probably
have to make sure that no code is called that has either no control points or
may take too long to complete. I suppose this also implies not using blocking
functions (apart from those i can interrupt myself).
Regards,
Bastian Schmitz
On Wednesday 18 June 2008, you wrote:
> 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,
> Kosta
>
> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20080618/4a41a969/attachment.bin
More information about the Mono-devel-list
mailing list