< prev index next >

src/hotspot/share/runtime/serviceThread.cpp

Print this page
rev 60025 : 8246476: remove AsyncDeflateIdleMonitors option and the safepoint based deflation mechanism


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




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

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


< prev index next >