Threads factory

Aleksey Shipilev aleksey.shipilev at
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.



More information about the jmh-dev mailing list