Skip to content

Commit f2abdfd

Browse files
committed
https://github.com/peter-lawrey/Java-Thread-Affinity/issues/18
1 parent d88d2fe commit f2abdfd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/vanilla/java/affinity/AffinityStrategies.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,14 @@ public boolean matches(int cpuId, int cpuId2) {
4343
}
4444
},
4545
/**
46-
* Must be a cpu on the same socket/chip.
46+
* Must be a cpu on the same socket/chip, different core.
4747
*/
4848
SAME_SOCKET {
4949
@Override
5050
public boolean matches(int cpuId, int cpuId2) {
5151
CpuLayout cpuLayout = AffinityLock.cpuLayout();
52-
return cpuLayout.socketId(cpuId) == cpuLayout.socketId(cpuId2);
52+
return cpuLayout.socketId(cpuId) == cpuLayout.socketId(cpuId2) &&
53+
cpuLayout.coreId(cpuId) != cpuLayout.coreId(cpuId2);
5354
}
5455
},
5556
/**

0 commit comments

Comments
 (0)