95 // Determines how many mutator threads can process the buffers in parallel.
96 uint DirtyCardQueueSet::num_par_ids() {
97 return (uint)os::processor_count();
98 }
99
100 void DirtyCardQueueSet::initialize(CardTableEntryClosure* cl,
101 Monitor* cbl_mon,
102 Mutex* fl_lock,
103 int process_completed_threshold,
104 int max_completed_queue,
105 Mutex* lock,
106 DirtyCardQueueSet* fl_owner) {
107 _mut_process_closure = cl;
108 PtrQueueSet::initialize(cbl_mon,
109 fl_lock,
110 process_completed_threshold,
111 max_completed_queue,
112 fl_owner);
113 set_buffer_size(G1UpdateBufferSize);
114 _shared_dirty_card_queue.set_lock(lock);
115 _free_ids = new FreeIdSet((int) num_par_ids(), _cbl_mon);
116 }
117
118 void DirtyCardQueueSet::handle_zero_index_for_thread(JavaThread* t) {
119 t->dirty_card_queue().handle_zero_index();
120 }
121
122 bool DirtyCardQueueSet::mut_process_buffer(void** buf) {
123
124 // Used to determine if we had already claimed a par_id
125 // before entering this method.
126 bool already_claimed = false;
127
128 // We grab the current JavaThread.
129 JavaThread* thread = JavaThread::current();
130
131 // We get the the number of any par_id that this thread
132 // might have already claimed.
133 uint worker_i = thread->get_claimed_par_id();
134
135 // If worker_i is not UINT_MAX then the thread has already claimed
|
95 // Determines how many mutator threads can process the buffers in parallel.
96 uint DirtyCardQueueSet::num_par_ids() {
97 return (uint)os::processor_count();
98 }
99
100 void DirtyCardQueueSet::initialize(CardTableEntryClosure* cl,
101 Monitor* cbl_mon,
102 Mutex* fl_lock,
103 int process_completed_threshold,
104 int max_completed_queue,
105 Mutex* lock,
106 DirtyCardQueueSet* fl_owner) {
107 _mut_process_closure = cl;
108 PtrQueueSet::initialize(cbl_mon,
109 fl_lock,
110 process_completed_threshold,
111 max_completed_queue,
112 fl_owner);
113 set_buffer_size(G1UpdateBufferSize);
114 _shared_dirty_card_queue.set_lock(lock);
115 _free_ids = new FreeIdSet(num_par_ids(), _cbl_mon);
116 }
117
118 void DirtyCardQueueSet::handle_zero_index_for_thread(JavaThread* t) {
119 t->dirty_card_queue().handle_zero_index();
120 }
121
122 bool DirtyCardQueueSet::mut_process_buffer(void** buf) {
123
124 // Used to determine if we had already claimed a par_id
125 // before entering this method.
126 bool already_claimed = false;
127
128 // We grab the current JavaThread.
129 JavaThread* thread = JavaThread::current();
130
131 // We get the the number of any par_id that this thread
132 // might have already claimed.
133 uint worker_i = thread->get_claimed_par_id();
134
135 // If worker_i is not UINT_MAX then the thread has already claimed
|