Reputation: 1808
Is there a particular condition in which Runtime.getRuntime().availableProcessors()
returns 0
?
Maybe when all proccessors are busy?
Upvotes: 1
Views: 1893
Reputation: 4975
No. According to the docs, Runtime.availableProcessors()
can never return less than one.
Returns: The maximum number of processors available to the virtual machine; never smaller than one
https://docs.oracle.com/javase/7/docs/api/java/lang/Runtime.html#availableProcessors()
Upvotes: 1
Reputation: 17144
No.
http://docs.oracle.com/javase/8/docs/api/java/lang/Runtime.html#availableProcessors--
"the maximum number of processors available to the virtual machine; never smaller than one"
Upvotes: 2