OpenHFT / OpenHFT/Java-Thread-Affinity

setAffinity does not work as expected in Windows

Open
#117 8 comments 0 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.9k
Forks
367
PR merge metrics
No merged PRs in 30d

Description

On win 11 got warning:
"Tried to set affinity to {7} but was {0,1,2,3,4,5,6,7} you may have insufficient access rights"
and nohing heppend - thread remain affined to all cores.

Java version: jdk-21.0.2.13-hotspot (Eclipse Adoptium)
jna and jna-platform verstion: 5.14.0
affinity version: 3.23.3

Thread, for which i try to lock affiniti created by :

Thread.ofPlatform().name("AffinedThread").start(() -> {
try (AffinityLock al = AffinityLock.acquireLock()) {
.....
}
});

Starting console in which java started with Admin rights change nothing.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.