< prev index next >

src/share/vm/gc/g1/dirtyCardQueue.cpp

Print this page




 143       if (!cl->do_card_ptr(card_ptr, worker_i)) {
 144         return false;
 145       }
 146     }
 147   }
 148   return true;
 149 }
 150 
 151 DirtyCardQueueSet::DirtyCardQueueSet(bool notify_when_complete) :
 152   PtrQueueSet(notify_when_complete),
 153   _mut_process_closure(NULL),
 154   _shared_dirty_card_queue(this, true /* permanent */),
 155   _free_ids(NULL),
 156   _processed_buffers_mut(0), _processed_buffers_rs_thread(0)
 157 {
 158   _all_active = true;
 159 }
 160 
 161 // Determines how many mutator threads can process the buffers in parallel.
 162 uint DirtyCardQueueSet::num_par_ids() {
 163   return (uint)os::processor_count();
 164 }
 165 
 166 void DirtyCardQueueSet::initialize(CardTableEntryClosure* cl,
 167                                    Monitor* cbl_mon,
 168                                    Mutex* fl_lock,
 169                                    int process_completed_threshold,
 170                                    int max_completed_queue,
 171                                    Mutex* lock,
 172                                    DirtyCardQueueSet* fl_owner,
 173                                    bool init_free_ids) {
 174   _mut_process_closure = cl;
 175   PtrQueueSet::initialize(cbl_mon,
 176                           fl_lock,
 177                           process_completed_threshold,
 178                           max_completed_queue,
 179                           fl_owner);
 180   set_buffer_size(G1UpdateBufferSize);
 181   _shared_dirty_card_queue.set_lock(lock);
 182   if (init_free_ids) {
 183     _free_ids = new FreeIdSet(num_par_ids(), _cbl_mon);




 143       if (!cl->do_card_ptr(card_ptr, worker_i)) {
 144         return false;
 145       }
 146     }
 147   }
 148   return true;
 149 }
 150 
 151 DirtyCardQueueSet::DirtyCardQueueSet(bool notify_when_complete) :
 152   PtrQueueSet(notify_when_complete),
 153   _mut_process_closure(NULL),
 154   _shared_dirty_card_queue(this, true /* permanent */),
 155   _free_ids(NULL),
 156   _processed_buffers_mut(0), _processed_buffers_rs_thread(0)
 157 {
 158   _all_active = true;
 159 }
 160 
 161 // Determines how many mutator threads can process the buffers in parallel.
 162 uint DirtyCardQueueSet::num_par_ids() {
 163   return (uint)os::active_processor_count();
 164 }
 165 
 166 void DirtyCardQueueSet::initialize(CardTableEntryClosure* cl,
 167                                    Monitor* cbl_mon,
 168                                    Mutex* fl_lock,
 169                                    int process_completed_threshold,
 170                                    int max_completed_queue,
 171                                    Mutex* lock,
 172                                    DirtyCardQueueSet* fl_owner,
 173                                    bool init_free_ids) {
 174   _mut_process_closure = cl;
 175   PtrQueueSet::initialize(cbl_mon,
 176                           fl_lock,
 177                           process_completed_threshold,
 178                           max_completed_queue,
 179                           fl_owner);
 180   set_buffer_size(G1UpdateBufferSize);
 181   _shared_dirty_card_queue.set_lock(lock);
 182   if (init_free_ids) {
 183     _free_ids = new FreeIdSet(num_par_ids(), _cbl_mon);


< prev index next >