Java & Usage of Multicore CPUs
The assumption is that the operating system will allocate threads to multiple cores. Assuming the OS is providing this support:
Runtime.getRuntime().availableProcessors()
This article describes writing a sort routine to use multiple cores:
http://www.javaworld.com/javaworld/jw-09-2007/jw-09-multicoreprocessing.html?page=2
Simple version: