RFR: 8320318: ObjectMonitor Responsible thread [v3]

Fredrik Bredberg fbredberg at openjdk.org
Wed Sep 18 18:29:23 UTC 2024


On Thu, 12 Sep 2024 00:04:51 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> As @xmas92 wrote, membar(StoreLoad); is all that we need between clearing the owner and checking the queues / successor. And, since I use membar(StoreLoad) in all other platforms, I wanted it to be consistent.
>> Also if you look in [ObjectMonitor::exit](https://github.com/openjdk/jdk/blob/f9ddfc6fb0780a7d6e933a40ecd3cd458a058f04/src/hotspot/share/runtime/objectMonitor.cpp#L1132C6-L1132C25)() you'll see that this there is a call to [OrderAccess::storeload](https://github.com/openjdk/jdk/blob/f9ddfc6fb0780a7d6e933a40ecd3cd458a058f04/src/hotspot/share/runtime/objectMonitor.cpp#L1184)() just after [release_clear_owner](https://github.com/openjdk/jdk/blob/f9ddfc6fb0780a7d6e933a40ecd3cd458a058f04/src/hotspot/share/runtime/objectMonitor.cpp#L1183)(), so I'm just doing the same as has been done in the C++ slow-path for long.
>
> When the key change here is "add in the missing fence that otherwise allowed stranding" then I would really like something to include the word "fence". Very few people will understand/recall the equivalence with storeload. A comment will suffice.

fixed

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/19454#discussion_r1765514377


More information about the hotspot-dev mailing list