From: mpir-...@googlegroups.com [mailto:mpir-...@googlegroups.com]
On Behalf Of Richard Marton
Sent: Thursday, November 08, 2012 2:09 PM
To: mpir-...@googlegroups.com
Subject: [mpir-devel] how would you recommend me to multithread an MPIR C++ application? pthread?
If your platform is windows, then native threads makes sense to me unless you need to run it on Posix systems also. If you need Posix support, then there is a Windows port of Pthreads that you can use. Sourceforge is one place that you can get it.
You could also launch separate processes and use shared memory, but threading is probably simpler.
<<
That number is trivially factored by brute force in a fraction of a second:
c:\Program Files\IBM\Informix\11.70\bin>factor 642565121024
first trying brute force division by small primes
PRIME FACTOR 2
PRIME FACTOR 2
PRIME FACTOR 2
PRIME FACTOR 2
PRIME FACTOR 2
PRIME FACTOR 2
PRIME FACTOR 2
PRIME FACTOR 2
PRIME FACTOR 2
PRIME FACTOR 2
PRIME FACTOR 19
PRIME FACTOR 19
PRIME FACTOR 53
PRIME FACTOR 32797
Certainly, assuming 2’s complement systems, you could divide by 2 until the number is no longer even.
For medium sized possible prime candidates, APR-CL is effective and is a proof (Miller-Rabin is a guess).
For larger numbers D. J. Bernstein, "Proving primality in essentially quartic random time" (2003)
From: mpir-...@googlegroups.com [mailto:mpir-...@googlegroups.com] On Behalf Of Richard Marton
Sent: Thursday, November 08, 2012 2:12 PM
To: mpir-...@googlegroups.com
--
You received this message because you are subscribed to the Google Groups "mpir-devel" group.
To view this discussion on the web visit https://groups.google.com/d/msg/mpir-devel/-/nPDV8XM6qSUJ.
I take it that the primes are up to about 512 bits in the examples you gave?
Lower limit is 8, upper is 3072 bits.
On my core 2 duo CPU 256bits finish in a second, 512 finishes in 2-4s, 1024 in 10-15s, 3072 bits are about 4-5 minutes using 1 core/thread.
Since 768 and 1024 bit lenght are considered safe for at least a few years, i think the speed is acceptable for practice.
--
You received this message because you are subscribed to the Google Groups "mpir-devel" group.
To view this discussion on the web visit https://groups.google.com/d/msg/mpir-devel/-/7qY67JideIUJ.