Ruud H.G. van Tol on Sat, 01 Jul 2023 13:15:42 +0200


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

Re: How to interrupt a MT calculation?



On 2023-06-30 17:17, Jean-Luc Arnaud wrote:
With 2^470-1, first result in 1728 ms, displayed after... 7min, 24,773 ms !!!

Is there another way to interrupt the script as soon as the "error" occurs?


I wonder if some "stop file" approach" would work here.
It comes down to having a shared "stop condition".

But then each iteration (or group of iterations, etc.) needs to check,
at least at the start, if that flag went up.

And if each iteration can take multiple seconds,
it should also check at loop borders,
without slowing things down too much.
(so no free lunch)


Examples of such stop-conditions:
- shared (error-count) variable is non-zero
- file doesn't exist
- file exists
- file is touched
- file is non-empty
- pipe is non-readable
(etc., just select the fastest)

-- Ruud