Javatpoint Logo
Javatpoint Logo

Java ForkJoinPool getRunningThreadCount() Method

The 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.

Syntax

Parameter

NA

Returns

This method returns the number of worker threads.

Example 1

Test it Now

Output:

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 2

Test it Now

Output:

Before invoking number of Running thread   :0
 After invoking Numbers of Running thread   :10
Common Pool Size   :10
Next TopicJava Forkjoinpool




Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials