33
34 // The G1 Concurrent Refinement Thread (could be several in the future).
35
36 class ConcurrentG1RefineThread: public ConcurrentGCThread {
37 friend class VMStructs;
38 friend class G1CollectedHeap;
39
40 double _vtime_start; // Initial virtual time.
41 double _vtime_accum; // Initial virtual time.
42 uint _worker_id;
43 uint _worker_id_offset;
44
45 // The refinement threads collection is linked list. A predecessor can activate a successor
46 // when the number of the rset update buffer crosses a certain threshold. A successor
47 // would self-deactivate when the number of the buffers falls below the threshold.
48 bool _active;
49 ConcurrentG1RefineThread* _next;
50 Monitor* _monitor;
51 ConcurrentG1Refine* _cg1r;
52
53 // The closure applied to completed log buffers.
54 CardTableEntryClosure* _refine_closure;
55
56 int _thread_threshold_step;
57 // This thread activation threshold
58 int _threshold;
59 // This thread deactivation threshold
60 int _deactivation_threshold;
61
62 void sample_young_list_rs_lengths();
63 void run_young_rs_sampling();
64 void wait_for_completed_buffers();
65
66 void set_active(bool x) { _active = x; }
67 bool is_active();
68 void activate();
69 void deactivate();
70
71 public:
72 virtual void run();
73 // Constructor
74 ConcurrentG1RefineThread(ConcurrentG1Refine* cg1r, ConcurrentG1RefineThread* next,
75 CardTableEntryClosure* refine_closure,
76 uint worker_id_offset, uint worker_id);
77
78 void initialize();
79
80 // Total virtual time so far.
81 double vtime_accum() { return _vtime_accum; }
82
83 ConcurrentG1Refine* cg1r() { return _cg1r; }
84
85 // shutdown
86 void stop();
87 };
88
89 #endif // SHARE_VM_GC_G1_CONCURRENTG1REFINETHREAD_HPP
|
33
34 // The G1 Concurrent Refinement Thread (could be several in the future).
35
36 class ConcurrentG1RefineThread: public ConcurrentGCThread {
37 friend class VMStructs;
38 friend class G1CollectedHeap;
39
40 double _vtime_start; // Initial virtual time.
41 double _vtime_accum; // Initial virtual time.
42 uint _worker_id;
43 uint _worker_id_offset;
44
45 // The refinement threads collection is linked list. A predecessor can activate a successor
46 // when the number of the rset update buffer crosses a certain threshold. A successor
47 // would self-deactivate when the number of the buffers falls below the threshold.
48 bool _active;
49 ConcurrentG1RefineThread* _next;
50 Monitor* _monitor;
51 ConcurrentG1Refine* _cg1r;
52
53 int _thread_threshold_step;
54 // This thread activation threshold
55 int _threshold;
56 // This thread deactivation threshold
57 int _deactivation_threshold;
58
59 void sample_young_list_rs_lengths();
60 void run_young_rs_sampling();
61 void wait_for_completed_buffers();
62
63 void set_active(bool x) { _active = x; }
64 bool is_active();
65 void activate();
66 void deactivate();
67
68 public:
69 virtual void run();
70 // Constructor
71 ConcurrentG1RefineThread(ConcurrentG1Refine* cg1r, ConcurrentG1RefineThread* next,
72 uint worker_id_offset, uint worker_id);
73
74 void initialize();
75
76 // Total virtual time so far.
77 double vtime_accum() { return _vtime_accum; }
78
79 ConcurrentG1Refine* cg1r() { return _cg1r; }
80
81 // shutdown
82 void stop();
83 };
84
85 #endif // SHARE_VM_GC_G1_CONCURRENTG1REFINETHREAD_HPP
|