Threads factory

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


Wicked! ;-)


________________________________
 From: Aleksey Shipilev <aleksey.shipilev at oracle.com>
To: Nitsan Wakart <nitsanw at yahoo.com> 
Cc: JMH Dev <jmh-dev at openjdk.java.net> 
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.

-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