In Java, is there a way to force a JVM instance to run on a single CPU/Core.
Additionally is there a way for given thread to figure out what CPU it is running on?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is not to be controlled at JVM/Java level, but at OS/platform level. In Windows for example, you can go to the Processes tab in the Task Manager and set the Affinity for most of the processes by choosing the appropriate option in the rightclick menu. With this you basically controls which CPU’s/cores the process is allowed to use.