Relates :
|
|
Relates :
|
A comment from Stefan K during the code review of JDK-8167108: 6) I think it would be nice if the SMR stuff in thread.hpp were encapsulated into an class instead of added directly to Thread and Threads. I sort-of expected the SMR variables to be moved to threadSMR.hpp. For example: class Threads: AllStatic { friend class VMStructs; private: + // Safe Memory Reclamation (SMR) support: + static Monitor* _smr_delete_lock; + // The '_cnt', '_max' and '_times" fields are enabled via + // -XX:+EnableThreadSMRStatistics: + static uint _smr_delete_lock_wait_cnt; + static uint _smr_delete_lock_wait_max; + static volatile int _smr_delete_notify; + static volatile jint _smr_deleted_thread_cnt; + static volatile jint _smr_deleted_thread_time_max; + static volatile jint _smr_deleted_thread_times; + static ThreadsList* volatile _smr_java_thread_list; + static ThreadsList* get_smr_java_thread_list() { + return (ThreadsList*)OrderAccess::load_ptr_acquire((void* volatile*)&_smr_java_thread_list); + } + static ThreadsList* xchg_smr_java_thread_list(ThreadsList* new_list) { + return (ThreadsList*)Atomic::xchg_ptr((void*)new_list, (volatile void*)&_smr_java_thread_list); + } + static long _smr_java_thread_list_alloc_cnt; + static long _smr_java_thread_list_free_cnt; + static uint _smr_java_thread_list_max; + static uint _smr_nested_thread_list_max; + static volatile jint _smr_tlh_cnt; + static volatile jint _smr_tlh_time_max; + static volatile jint _smr_tlh_times; + static ThreadsList* _smr_to_delete_list; + static uint _smr_to_delete_list_cnt; + static uint _smr_to_delete_list_max; Could be: class Threads: AllStatic { friend class VMStructs; private: // Safe Memory Reclamation (SMR) support: SMRSupport _smr_support; And SMRSupport could be moved to threadSMR.hpp.