Package org.ddogleg

Class DDoglegConcurrency


public class DDoglegConcurrency extends ConcurrencyOps
Used to turn on and off functions/classes which can automatically switch between concurrent operations
  • Field Details

    • USE_CONCURRENT

      public static boolean USE_CONCURRENT
      Used to toggle auto matic switching to concurrent algorithms
  • Constructor Details

    • DDoglegConcurrency

      public DDoglegConcurrency()
  • Method Details

    • setMaxThreads

      public static void setMaxThreads(int maxThreads)
      Sets the maximum number of threads available in the thread pool and adjusts USE_CONCURRENT. If the number of threads is less than 2 then USE_CONCURRENT will be set to false and the single thread version of code will be called. Otherwise USE_CONCURRENT will be true and the max threads in the pool set to the specified number.
      Parameters:
      maxThreads - Maximum number of threads. ≤ 1 means it will not be threaded.
    • isUseConcurrent

      public static boolean isUseConcurrent()