RFR: 8292679: Simplify thread creation in gtest and port 2 tests to new way
Johan Sjölén
duke at openjdk.org
Mon Aug 22 17:09:34 UTC 2022
On Mon, 22 Aug 2022 14:41:29 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
>So we have F, which is kind of clear, S, which is a state?, and then also a state generator? Which apparently needs to define operator () and return a state?
>Could you please document what the template parameters are and what is expected of them?
Absolutely. I'll also lengthen their name, to make them more clear-
>Does N really need to be a template parameter? You lose flexibility, and it is less readable too.
What flexibility are we losing? We're not going to be dynamically reallocate the amount of threads in a `TestThreadGroup`, or is this the exact use case you're imagining in the future?
I don't think it's necessarily less readable. It's fairly standard in C++ STL to use template arguments for sizes (see `std::array`). I know we typically use raw pointers and length variables in Hotspot, so it's certainly unidiomatic from those eyes. To me, it's more readable, because it's a hint to me that "aha, this size won't change during execution".
-------------
PR: https://git.openjdk.org/jdk/pull/9962
More information about the hotspot-dev
mailing list