I'm trying to find a way to make two processes; java
and javaw
separate over a set of cores (0-1 and 6-7) to make the programme I'm running go faster as I am using a client and server and both will only use a maximum of two cores, no more each. I can do this manually, but would like to find a less time taking method of getting it done.
Asked
Active
Viewed 91 times
0

dizzyzane
- 3
- 3
-
Create two threads in each and let the operating system schedule them? If you need finer grained control, investigate how to tell your operating system what you need. – Thorbjørn Ravn Andersen Jul 20 '14 at 09:15
1 Answers
0
I assume you are using Windows. What you want to do is set the processor affinity mask.
If you want to run a process on core 0 and 1 start the application using
start /AFFINITY 03 <program>
which uses the bitmask 0x03 (00000011 in binary).
If you want to run a process on core 6 and 7 start the application using
start /AFFFINITY CO <program>
which uses the bitmask 0xCO (11000000 in binary).
Also check Set affinity with start /AFFINITY command on Windows 7