Threads factory

Nitsan Wakart nitsanw at
Tue Jun 11 02:42:25 PDT 2013

Wicked! ;-)

 From: Aleksey Shipilev <aleksey.shipilev at>
To: Nitsan Wakart <nitsanw at> 
Cc: JMH Dev <jmh-dev at> 
Sent: Tuesday, June 11, 2013 11:23 AM
Subject: Re: Threads factory

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