Java ForkJoinPool getRunningThreadCount() MethodThe getRunningThreadCount() method of ForkJoinPool class returns the number of thread that is currently running that are not blocked waiting to join tasks. This method may overestimate the number of running thread. SyntaxParameterNA ReturnsThis method returns the number of worker threads. Example 1Test it NowOutput: numbers of core available in your processor:2 Before invoking number of active thread :0 After invoking Numbers of active thread :1 Common Pool Size :1 Example 2Test it NowOutput: Before invoking number of Running thread :0 After invoking Numbers of Running thread :10 Common Pool Size :10
Next TopicJava Forkjoinpool
|