Notes |
|
(0000702)
|
pbone
|
2014-06-20 11:49
|
|
Hi Peter,
I'm about to do some work on the Java concurrency stuff for MCit. So I'll look at this at the same time.
Thanks. |
|
|
|
The behaviour of multi-threaded programs when the main thread terminates needs to be specified
somewhere, reference manual(?) or in the comment at the head of thread.m. Furthermore the behaviour
should be consistent across backends. |
|
|
(0000712)
|
pbone
|
2014-06-26 18:50
|
|
Hi.
What should be the behavior if an error is raised. For example:
+ The exit status is set to non-zero (I think it should wait).
+ An exception is uncaught in main/2 (Should it exit immediately?)
+ Can a mercury program call abort() like one can in C?
+ An internal error (in Mercury) (it should exit immediately).
Thanks |
|
|
(0000714)
|
wangp
|
2014-06-27 10:51
|
|
> What should be the behavior if an error is raised. For example:
> + The exit status is set to non-zero (I think it should wait).
Yes. It just sets a global variable.
> + An exception is uncaught in main/2 (Should it exit immediately?)
I think so.
> + Can a mercury program call abort() like one can in C?
Yes. Mercury can't prevent anyone doing so anyway.
> + An internal error (in Mercury) (it should exit immediately).
Yes. We can't continue after an internal (fatal) error. |
|
|
(0000715)
|
pbone
|
2014-06-27 10:55
|
|
> > + Can a mercury program call abort() like one can in C?
>
> Yes. Mercury can't prevent anyone doing so anyway.
What I mean is, do we provide something like abort in Mercury? (I don't remember one myself), something like:
:- pred abort(int::in, io::di, io::uo) is det.
Which doesn't return. |
|
|
|
By making the determinism of abort/3 det, you are telling the compiler that it _does_ return.
A better signature would be:
:- pred abort(int::in, io::di) is erroneous.
In any case, I don't see the need for abort in Mercury. Every time I have needed something like it, throwing an exception back to the top-level has always sufficed. |
|
|
(0000718)
|
pbone
|
2014-06-27 11:20
|
|
Okay cool, I wasn't proposing abort/3 just asking if we already had something like this. |
|
|
(0000980)
|
pbone
|
2018-03-13 14:38
|
|
Unassigned things from me. |
|