Setting CPU Affinity in Combination with JMH Forks
Volkan Yazıcı
volkan.yazici at gmail.com
Mon Dec 3 19:09:08 UTC 2018
Hello,
In fiber-test <https://github.com/vy/fiber-test/>, I clash various fiber
(coroutine, actor, lightweight thread, whatever you call it)
implementations targeting JVM -- including Project Loom! Here some
libraries are capable of implicitly exploiting multiple cores, some aren't.
To obtain an apples-to-apples comparison, I want confine all the benchmarks
to a single CPU core. For this purpose, I tried various approaches:
$ taskset -c 0 ./benchmark/benchmark.py
$ taskset -c 0 docker run ...
$ docker run --cpuset-cpus=0 ...
Though in each case, if JMH forks (determined by benchmark.py) are enabled,
JMH just hangs. When I disable forks, everything starts working as
intended. Would anybody mind helping me to figure out what am I missing? Or
is there any other way to achieve the same effect? Or... Does what I want,
confining the benchmark to a single core, make sense at all?
Best.
More information about the jmh-dev
mailing list