JMH Question: execution of code when iteration completes before TearDown
Aleksey Shipilev
shade at redhat.com
Fri Sep 23 06:24:55 UTC 2016
Hi,
On 09/22/2016 06:36 PM, Alexei Osipov wrote:
> Is it possible to get something executed after a thread finishes *last*
> invocation in benchmark iteration and before it goes to preTearDown.await()?
There is no good answer for this.
> I have asymmetric JMH test for a blocking queue-like data structure and
> can't find what's proper way to execute actions that will unblock treads
> blocking on my queue in JMH. I've supposed to do "unblocking" in @TearDown
> part of thread-specific state but it seems like @TearDown is not executed
> till all threads are finished.
See this sample:
http://hg.openjdk.java.net/code-tools/jmh/file/e810ce09937a/jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_30_Interrupts.java
Thanks,
-Aleksey
More information about the jmh-dev
mailing list