Threads factory

Aleksey Shipilev aleksey.shipilev at oracle.com
Tue Jun 11 02:23:52 PDT 2013


On 06/11/2013 01:15 PM, Nitsan Wakart wrote:
> Hi, I'd like to benchmark an approach which requires me to modify the
> Thread class in use, is there a way for me to provide JMH with a
> ThreadFactory or something? Thanks, Nitsan

There is a rudimentary support for switching executors, see
BaseMicroBenchmarkHandler.createExecutor() [1]. I think you can hack it
to accept ThreadFactory class name as String, and instantiate it via
Reflection. If you do this, fill out the OCA [2], and submit the patch back.

-Aleksey.

[1]
http://hg.openjdk.java.net/code-tools/jmh/file/81994ce1bd24/jmh-core/src/main/java/org/openjdk/jmh/runner/BaseMicroBenchmarkHandler.java
[2] http://openjdk.java.net/contribute/


More information about the jmh-dev mailing list