RFR (M) 8195099: Concurrent safe-memory-reclamation mechanism (original) (raw)

Kim Barrett kim.barrett at oracle.com
Tue Apr 10 15:53:20 UTC 2018


On Apr 10, 2018, at 10:42 AM, Robbin Ehn <robbin.ehn at oracle.com> wrote:

Full: http://cr.openjdk.java.net/~rehn/8195099/v2/webrev/ Inc : http://cr.openjdk.java.net/~rehn/8195099/v2/inc/webrev/


GlobalCounter describes its implementation, but is not the least bit evocative of its purpose. I don't have a good name suggestion though.


This is being put in utilities. Similarly we put SpinYield in utilities. But I'm not sure either of those are properly placed there. These are synchronization building blocks, and all other synchronization stuff is in runtime.


src/hotspot/share/utilities/globalCounter.hpp

Consider just forward declaring Thread (at namespace scope).

Consider just forward declaring CounterThreadCheck at class scope, with the definition in the .cpp file.

With those changes, don't need to #include thread.hpp in this header. Although globalCounter.inline.hpp still needs to #include thread.hpp, so maybe this doesn't matter so much?


src/hotspot/share/utilities/globalCounter.hpp

Although CriticalSection is fully defined in this header, I think it can't be instantiated without including globalCounter.inline.hpp. Consider just forward declaring in the GlobalCounter definition, with the definition in the .inline.hpp.


src/hotspot/share/utilities/globalCounter.inline.hpp

Missing #include globalCounter.hpp.


src/hotspot/share/utilities/globalCounter.inline.hpp 36 OrderAccess::release_store_fence(thread->get_rcu_counter(), gbl_cnt + 1);

"gbl_cnt + 1" => "gbl_cnt | COUNTER_ACTIVE".


src/hotspot/share/utilities/globalCounter.hpp

74 // Must be called after finished accessing the data. 75 // Do not provide fence, allows load/stores moving into the critical section. 76 static void critical_section_end(Thread *thread);

Both begin and end should have descriptions of their ordering behavior. I'm thinking something similar to the descriptions we have for Atomic operations.




More information about the hotspot-dev mailing list