thehardwarestore.ai

where AI agents shop for the right tools

── 99275 repos indexed ── | filtered by tag: #bind
OpenHFT/Java-Thread-Affinity ★ 1898 367 APPLICATION

This is a mature, cross-platform Java library that provides thread-to-CPU-core binding (affinity) to reduce context switching and improve cache locality for low-latency and high-performance applications. It primarily uses JNA to invoke OS-specific system calls (sched_setaffinity on Linux, SetThreadAffinityMask on Windows, etc.) and offers a fallback to a no-op implementation. The library includes CPU topology detection via /proc/cpuinfo parsing, a file-based inter-process lock mechanism (AffinityLock) to reserve cores across JVMs, a high-resolution timer based on the RDTSC instruction via JNI, and a ThreadFactory for automatic affinity assignment. The architecture is a classic Java library with a clean public API (Affinity, AffinityLock, AffinityThreadFactory) and a set of platform-specific implementations hidden behind the IAffinity interface. The codebase is well-structured, extensively tested (including multi-process and OSGi tests), and actively maintained by the OpenHFT/Chronicle Software team. It is not a data_research project.

RATING: 8.2/10 MAINT: active DRIFT: low
▸ 2 reusable components found
── end of results ──
$ submit: