On Thu, 8 Oct 2026 01:10:31 GMT, David Holmes <[email protected]> wrote:
> Drive-by comment as I don't deal at all with JMH, but does running this kind
> of benchmark with more than one worker actually make any sense? These seem
> intended to be trivial single-threaded benchmarks.
I agree that using multiple workers here doesn't seem particularly useful.
But there doesn't seem to be an elegant way to keep a single worker when `-t 2`
is specified:
- `@Threads(1)` can still be overridden by `-t 2`.
- Checking the worker count would only report an error, rather than run with
one worker:
if (params.getThreads() != 1) {
throw new IllegalArgumentException(
"ThreadStartJoin requires exactly one JMH worker; use -t 1");
}
So, this PR mainly addresses the failure when multiple workers are used.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/33239#issuecomment-6057597395