Max Alekseyev on Thu, 19 Sep 2024 23:13:42 +0200


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

Re: concurrent computation of a function


Hi Bill,

I'm also looking at using extern(). How can one perform necessary process control from inside the GP?
I'd like to perform the following actions:
* to run two other GP scripts with extern();
* get a result from whoever first produces it;
* kill the remaining GP rocess.
Does GP have a suitable functionality for that?

Regards,
Max


On Thu, Sep 19, 2024 at 4:22 PM Bill Allombert <Bill.Allombert@math.u-bordeaux.fr> wrote:
On Thu, Sep 19, 2024 at 03:25:32PM -0400, Max Alekseyev wrote:
> Using "seriesprecision" as a semaphore for communication between processes
> is a neat idea, but in my case one of the functions relies on integer
> factorization, which may or may not take a long time.
> I do not see how factor() function can be terminated if the other function
> signals it to end.
> Or is there a way?

Not without changing the C code.

If you are really desperate you can run each computation in a different
GP instances, using extern().

Cheers,
Bill