|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apfloat.samples.Pi | +--org.apfloat.samples.PiParallel
Calculates pi using multiple threads in parallel.
Note that to get any performance gain from running many threads in parallel, the JVM must be executing native threads. If the JVM is running in green threads mode, there is no advantage of having multiple threads, as the JVM will in fact execute just one thread and divide its time to multiple simulated threads.
Nested Class Summary | |
protected static class |
PiParallel.ParallelPiCalculator
Parallel version of the Chudnovskys' binary splitting algorithm. |
protected static class |
PiParallel.ThreadLimitedOperation
Class to execute operations while setting ApfloatContext.setNumberOfProcessors(int)
to some value. |
Nested classes inherited from class org.apfloat.samples.Pi |
Pi.BorweinPiCalculator, Pi.ChudnovskyProgressIndicator, Pi.GaussLegendrePiCalculator |
Field Summary |
Fields inherited from class org.apfloat.samples.Pi |
err, out |
Method Summary | |
static void |
main(java.lang.String[] args)
Command-line entry point. |
Methods inherited from class org.apfloat.samples.Pi |
checkAlive, getErr, getInt, getLong, getOut, getPrecision, getRadix, run, setAlive, setErr, setOut |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static void main(java.lang.String[] args) throws java.io.IOException, ApfloatRuntimeException
args
- Command-line parameters.
java.io.IOException
- In case writing the output fails.
ApfloatRuntimeException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |