Class PiParallel

  • Direct Known Subclasses:
    PiDistributed

    public class PiParallel
    extends Pi
    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.

    Version:
    1.14.0
    • Constructor Detail

      • PiParallel

        PiParallel()
    • Method Detail

      • main

        public static void main​(java.lang.String[] args)
                         throws java.io.IOException,
                                ApfloatRuntimeException
        Command-line entry point.
        Parameters:
        args - Command-line parameters.
        Throws:
        java.io.IOException - In case writing the output fails.
        ApfloatRuntimeException