Dec 15

The Runtime class has an availableProcessors method that returns the number of processors available to the JVM.

int processors = Runtime.getRuntime().availableProcessors();

The value may change during the execution of your application, so poll regularly if your application is dependant on the number of processors available.

written by objects \\ tags: , , ,