Module dev.civl.gmc

Class MyThreadPool

java.lang.Object
dev.civl.gmc.concurrent.MyThreadPool

public class MyThreadPool extends Object
The threadPool That is used to manage the threads used in the algorithm.
  • Constructor Details

    • MyThreadPool

      public MyThreadPool(int parallelism)
    • MyThreadPool

      public MyThreadPool()
  • Method Details

    • incrementWaiting

      public void incrementWaiting()
      Increase the counter for waiting threads.
    • decrementWaiting

      public void decrementWaiting()
      Decrease the counter for waiting threads.
    • incrementTotal

      public void incrementTotal()
    • decrementTotal

      public void decrementTotal()
    • getActiveNum

      public int getActiveNum()
      Returns:
      the number of threads that are currently executing (not include waiting threads).
    • getRunningNum

      public int getRunningNum()
      Returns:
      the total number of threads (include threads that are waiting).
    • submit

      public void submit(ForkJoinTask<Integer> task)
    • isQuiescent

      public boolean isQuiescent()
    • getMaxNumOfThread

      public int getMaxNumOfThread()
    • shutdown

      public void shutdown()