Javatpoint Logo
Javatpoint Logo

Java ForkJoinPool getStealCount() method

The getStealCount() method of ForkJoinPool class returns estimation of a number of tasks stolen from one thread by another after completing execution of all tasks in own queue. Steal count is high enough to keep thread busy but also it does not avoid overhead.

Syntax

Parameter

No parameter is passed.

Returns

This method returns the number of steals.

Example 1

Test it Now

Output:

Steal Count  :0

Example 2

Test it Now

Output:

numbers of core available in your processor:2
 Before Queued Submission  :0
  is awaitQuiescent :true
 Steal Count  :0
Pool.invoke :161
Next TopicJava Forkjoinpool




Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials