I'm running a jmh benchmark, but the invocations in each trial are occurring in serial. How can I make the invocations run concurrently?
Here's a summary of my code:
@State(Scope.Benchmark)
public class FooBenchmark {
@Param({"123456"})
public int barId;
@Setup
public void setup() {
}
@Benchmark
public void run(Blackhole hole) {
System.out.println("A"); // for proof that it's serial (see below)
...
System.out.println("B"); // for proof that it's serial (see below)
}
}
This will print A and then B. Will never give two consecutive A's or B's.