Setup and TearDown executed by different threads
Aleksey Shipilev
aleksey.shipilev at oracle.com
Fri Aug 15 13:59:00 UTC 2014
On 08/13/2014 06:54 PM, Aleksey Shipilev wrote:
> Let me see how messy it would be to track the @Setup/@TearDown callers.
Okay, it seems messier than I expected at the first glance. There are
multiple things to consider when tracking the @State owner:
- do we share the owner across multiple Levels?
- what do we do if the owner exits abruptly?
- how do we handle the absence of paired @Setup/@TearDowns?
- ...?
Not that isn't not doable, but the change seems too intrusive to do in a
Release Candidate. It also intersects with Chris Vest's example of
benchmark being stuck if one of the threads in asymmetric benchmarks
throws the exception. Let us consider this for post 1.0 revisions.
I had updated the @Setup/@TearDown Javadocs to (un)specify which thread
is going to call the fixture methods though.
Thanks,
-Aleksey.
More information about the jmh-dev
mailing list