< prev index next >

src/hotspot/share/gc/shared/referenceProcessor.hpp

Print this page
rev 52116 : 8212122: Allow ReferenceProcessor to always be MT processing


 661     : _ref_processor(ref_processor),
 662       _marks_oops_alive(marks_oops_alive),
 663       _phase_times(phase_times)
 664   { }
 665 
 666 public:
 667   virtual void work(uint worker_id,
 668                     BoolObjectClosure& is_alive,
 669                     OopClosure& keep_alive,
 670                     VoidClosure& complete_gc) = 0;
 671 
 672   bool marks_oops_alive() const { return _marks_oops_alive; }
 673 };
 674 
 675 // Temporarily change the number of workers based on given reference count.
 676 // This ergonomically decided worker count will be used to activate worker threads.
 677 class RefProcMTDegreeAdjuster : public StackObj {
 678   typedef ReferenceProcessor::RefProcPhases RefProcPhases;
 679 
 680   ReferenceProcessor* _rp;
 681   bool                _saved_mt_processing;
 682   uint                _saved_num_queues;
 683 
 684   // Calculate based on total of references.
 685   uint ergo_proc_thread_count(size_t ref_count,
 686                               uint max_threads,
 687                               RefProcPhases phase) const;
 688 
 689   bool use_max_threads(RefProcPhases phase) const;
 690 
 691 public:
 692   RefProcMTDegreeAdjuster(ReferenceProcessor* rp,
 693                           RefProcPhases phase,
 694                           size_t ref_count);
 695   ~RefProcMTDegreeAdjuster();
 696 };
 697 
 698 #endif // SHARE_VM_GC_SHARED_REFERENCEPROCESSOR_HPP


 661     : _ref_processor(ref_processor),
 662       _marks_oops_alive(marks_oops_alive),
 663       _phase_times(phase_times)
 664   { }
 665 
 666 public:
 667   virtual void work(uint worker_id,
 668                     BoolObjectClosure& is_alive,
 669                     OopClosure& keep_alive,
 670                     VoidClosure& complete_gc) = 0;
 671 
 672   bool marks_oops_alive() const { return _marks_oops_alive; }
 673 };
 674 
 675 // Temporarily change the number of workers based on given reference count.
 676 // This ergonomically decided worker count will be used to activate worker threads.
 677 class RefProcMTDegreeAdjuster : public StackObj {
 678   typedef ReferenceProcessor::RefProcPhases RefProcPhases;
 679 
 680   ReferenceProcessor* _rp;

 681   uint                _saved_num_queues;
 682 
 683   // Calculate based on total of references.
 684   uint ergo_proc_thread_count(size_t ref_count,
 685                               uint max_threads,
 686                               RefProcPhases phase) const;
 687 
 688   bool use_max_threads(RefProcPhases phase) const;
 689 
 690 public:
 691   RefProcMTDegreeAdjuster(ReferenceProcessor* rp,
 692                           RefProcPhases phase,
 693                           size_t ref_count);
 694   ~RefProcMTDegreeAdjuster();
 695 };
 696 
 697 #endif // SHARE_VM_GC_SHARED_REFERENCEPROCESSOR_HPP
< prev index next >