< prev index next >

src/hotspot/share/runtime/serviceThread.cpp

Print this page
rev 60098 : 8246476: remove AsyncDeflateIdleMonitors option and the safepoint based deflation mechanism
Reviewed-by: dholmes, pchilanomate, coleenp


 125       ThreadBlockInVM tbivm(jt);
 126 
 127       MonitorLocker ml(Service_lock, Mutex::_no_safepoint_check_flag);
 128       // Process all available work on each (outer) iteration, rather than
 129       // only the first recognized bit of work, to avoid frequently true early
 130       // tests from potentially starving later work.  Hence the use of
 131       // arithmetic-or to combine results; we don't want short-circuiting.
 132       while (((sensors_changed = (!UseNotificationThread && LowMemoryDetector::has_pending_requests())) |
 133               (has_jvmti_events = _jvmti_service_queue.has_events()) |
 134               (has_gc_notification_event = (!UseNotificationThread && GCNotifier::has_event())) |
 135               (has_dcmd_notification_event = (!UseNotificationThread && DCmdFactory::has_pending_jmx_notification())) |
 136               (stringtable_work = StringTable::has_work()) |
 137               (symboltable_work = SymbolTable::has_work()) |
 138               (resolved_method_table_work = ResolvedMethodTable::has_work()) |
 139               (thread_id_table_work = ThreadIdTable::has_work()) |
 140               (protection_domain_table_work = SystemDictionary::pd_cache_table()->has_work()) |
 141               (oopstorage_work = OopStorage::has_cleanup_work_and_reset()) |
 142               (deflate_idle_monitors = ObjectSynchronizer::is_async_deflation_needed())
 143              ) == 0) {
 144         // Wait until notified that there is some work to do.
 145         // If AsyncDeflateIdleMonitors, then we wait for
 146         // GuaranteedSafepointInterval so that is_async_deflation_needed()
 147         // is checked at the same interval.
 148         ml.wait(AsyncDeflateIdleMonitors ? GuaranteedSafepointInterval : 0);
 149       }
 150 
 151       if (has_jvmti_events) {
 152         // Get the event under the Service_lock
 153         jvmti_event = _jvmti_service_queue.dequeue();
 154         _jvmti_event = &jvmti_event;
 155       }
 156     }
 157 
 158     if (stringtable_work) {
 159       StringTable::do_concurrent_work(jt);
 160     }
 161 
 162     if (symboltable_work) {
 163       SymbolTable::do_concurrent_work(jt);
 164     }
 165 
 166     if (has_jvmti_events) {
 167       _jvmti_event->post();
 168       _jvmti_event = NULL;  // reset




 125       ThreadBlockInVM tbivm(jt);
 126 
 127       MonitorLocker ml(Service_lock, Mutex::_no_safepoint_check_flag);
 128       // Process all available work on each (outer) iteration, rather than
 129       // only the first recognized bit of work, to avoid frequently true early
 130       // tests from potentially starving later work.  Hence the use of
 131       // arithmetic-or to combine results; we don't want short-circuiting.
 132       while (((sensors_changed = (!UseNotificationThread && LowMemoryDetector::has_pending_requests())) |
 133               (has_jvmti_events = _jvmti_service_queue.has_events()) |
 134               (has_gc_notification_event = (!UseNotificationThread && GCNotifier::has_event())) |
 135               (has_dcmd_notification_event = (!UseNotificationThread && DCmdFactory::has_pending_jmx_notification())) |
 136               (stringtable_work = StringTable::has_work()) |
 137               (symboltable_work = SymbolTable::has_work()) |
 138               (resolved_method_table_work = ResolvedMethodTable::has_work()) |
 139               (thread_id_table_work = ThreadIdTable::has_work()) |
 140               (protection_domain_table_work = SystemDictionary::pd_cache_table()->has_work()) |
 141               (oopstorage_work = OopStorage::has_cleanup_work_and_reset()) |
 142               (deflate_idle_monitors = ObjectSynchronizer::is_async_deflation_needed())
 143              ) == 0) {
 144         // Wait until notified that there is some work to do.
 145         // We wait for GuaranteedSafepointInterval so that
 146         // is_async_deflation_needed() is checked at the same interval.
 147         ml.wait(GuaranteedSafepointInterval);

 148       }
 149 
 150       if (has_jvmti_events) {
 151         // Get the event under the Service_lock
 152         jvmti_event = _jvmti_service_queue.dequeue();
 153         _jvmti_event = &jvmti_event;
 154       }
 155     }
 156 
 157     if (stringtable_work) {
 158       StringTable::do_concurrent_work(jt);
 159     }
 160 
 161     if (symboltable_work) {
 162       SymbolTable::do_concurrent_work(jt);
 163     }
 164 
 165     if (has_jvmti_events) {
 166       _jvmti_event->post();
 167       _jvmti_event = NULL;  // reset


< prev index next >