Suggestion to stop long operations

Torbjörn Granlund tg at gmplib.org
Fri Nov 18 22:44:45 UTC 2016


Pierre Chatelier <pierre at chachatelier.fr> writes:

  While playing with mpz_probab_prime_p(), I noticed that comptation times
  could be very long for serious numbers (like 6917!-1, which is a "small"
  prime in some sense, regarding https://primes.utm.edu/largest.html) I
  think it could be valuable to be able to stop such computations if it
  takes too long.
  
I believe every operating system provides mechanisms for such things.
Trying to keep track of time inside low-level computations seems like a
poor idea to me.

(Processes can have many type of resources limited, including time.
Threads in unix have less controls, but one can set up timer alarms and
do pthread_kill.  This is all beyond the scope of the GMP lists.)
  

-- 
Torbjörn
Please encrypt, key id 0xC8601622


More information about the gmp-discuss mailing list