On Fri, 24 Mar 2023 19:13:39 GMT, Chris Plummer <cjplum...@openjdk.org> wrote:
>> It is needed to balance enabling/disabling notifyJvmti mode with the >> ThreadStart/VirtualThreadStart events. >> Otherwise, many mode switches can be observed without any events which is >> not interesting. >> We need to allow virtual threads to execute a little bit after a mode switch. > > Shouldn't that be the caller's responsibility? Including a comment would be > helpful. Okay, moved to the caller. In fact, I've refactored the test even more for safety purposes. Will describe it separately. >> Good question. We almost always do it in the JVMTI tests including >> `serviceability/jvmti/vthread` and `vmTestbase/nsk/jvmti` tests. Examples >> are 22 `serviceability/jvmti/vthread` tests. > > Are you saying it's not needed, but you included it to be consistent with > other tests? I remember it was really needed some time ago but do not remember why. Removed it now. Then we have a technical debt to get rid of this in all JVMTI tests with the `-agentlib` option. >> I'm not sure if it is really needed. 60 virtual threads are started. >> Some of them are executed long enough before shutdown. >> We can just increase the number of threads if necessary. > > ok I've refactored the test, and it has impacted this fragment. Please, see my comment above. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/13133#discussion_r1149968287 PR Review Comment: https://git.openjdk.org/jdk/pull/13133#discussion_r1149967613 PR Review Comment: https://git.openjdk.org/jdk/pull/13133#discussion_r1149969217