Jean-Luc Arnaud on Sun, 02 Jul 2023 00:50:48 +0200


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

Re: How to interrupt a MT calculation?


Le 01/07/2023 à 21:55, Bill Allombert a écrit :
On Sat, Jul 01, 2023 at 02:50:15PM +0200, Bill Allombert wrote:
On Sat, Jul 01, 2023 at 01:30:35PM +0200, Loïc Grenié wrote:
On Sat 1 Jul 2023 aT 12:39, Bill Allombert wrote:

On Sat, Jul 01, 2023 at 01:04:49AM +0200, Jean-Luc Arnaud wrote:
So, it seems like error does not work the same way on Linux (and probably
Windows) versus Mac OS, or is there a bug in the 2.16.0 Alpha version?
No this is a limitation of pthread on macos:
<
https://stackoverflow.com/questions/43109438/macos-macoss-pthread-pthread-cancel-asynchronous-not-working
      Definitely not the recommended way, but could a SEGV help?

install("getpid","l")
extern(Str("kill -SEGV ", getpid()))
That would not help: PARI will catch the SEGV and then call pthread_cancel to cancel the threads.
No, your best bet is to make new_chunk or set_avma a cancellation point, but this slows down GP.
Jean-Luc,
you can try the following patch, it should fix this, but it will slowdown GP a bit.
(you will need to do 'make clean')

Cheers,
Bill

Thanks a lot, Bill.

Nevertheless, as I wrote in a previous message, I'm using my own interface to an interactive Mac OS Shell.

So, I can list all GP-Pari threads running and, as soon as one stops, kill the others and so stop the calculation.

I will try that and let you know, if any interest...

Jean-Luc