< prev index next >

src/share/vm/gc/parallel/gcTaskThread.cpp

Print this page




  90                                 time_stamp->entry_time(),
  91                                 time_stamp->exit_time());
  92     }
  93 
  94     // Reset after dumping the data
  95     _time_stamp_index = 0;
  96   }
  97 }
  98 
  99 // GC workers get tasks from the GCTaskManager and execute
 100 // them in this method.  If there are no tasks to execute,
 101 // the GC workers wait in the GCTaskManager's get_task()
 102 // for tasks to be enqueued for execution.
 103 
 104 void GCTaskThread::run() {
 105   // Set up the thread for stack overflow support
 106   this->record_stack_base_and_size();
 107   this->initialize_named_thread();
 108   // Bind yourself to your processor.
 109   if (processor_id() != GCTaskManager::sentinel_worker()) {
 110     if (TraceGCTaskThread) {
 111       tty->print_cr("GCTaskThread::run: "
 112                     "  binding to processor %u", processor_id());
 113     }
 114     if (!os::bind_to_processor(processor_id())) {
 115       DEBUG_ONLY(
 116         log_warning(gc)("Couldn't bind GCTaskThread %u to processor %u",
 117                         which(), processor_id());
 118       )
 119     }
 120   }
 121   // Part of thread setup.
 122   // ??? Are these set up once here to make subsequent ones fast?
 123   HandleMark   hm_outer;
 124   ResourceMark rm_outer;
 125 
 126   TimeStamp timer;
 127 
 128   for (;/* ever */;) {
 129     // These are so we can flush the resources allocated in the inner loop.
 130     HandleMark   hm_inner;
 131     ResourceMark rm_inner;
 132     for (; /* break */; ) {
 133       // This will block until there is a task to be gotten.




  90                                 time_stamp->entry_time(),
  91                                 time_stamp->exit_time());
  92     }
  93 
  94     // Reset after dumping the data
  95     _time_stamp_index = 0;
  96   }
  97 }
  98 
  99 // GC workers get tasks from the GCTaskManager and execute
 100 // them in this method.  If there are no tasks to execute,
 101 // the GC workers wait in the GCTaskManager's get_task()
 102 // for tasks to be enqueued for execution.
 103 
 104 void GCTaskThread::run() {
 105   // Set up the thread for stack overflow support
 106   this->record_stack_base_and_size();
 107   this->initialize_named_thread();
 108   // Bind yourself to your processor.
 109   if (processor_id() != GCTaskManager::sentinel_worker()) {
 110     log_trace(gc, task, thread)("GCTaskThread::run: binding to processor %u", processor_id());



 111     if (!os::bind_to_processor(processor_id())) {
 112       DEBUG_ONLY(
 113         log_warning(gc)("Couldn't bind GCTaskThread %u to processor %u",
 114                         which(), processor_id());
 115       )
 116     }
 117   }
 118   // Part of thread setup.
 119   // ??? Are these set up once here to make subsequent ones fast?
 120   HandleMark   hm_outer;
 121   ResourceMark rm_outer;
 122 
 123   TimeStamp timer;
 124 
 125   for (;/* ever */;) {
 126     // These are so we can flush the resources allocated in the inner loop.
 127     HandleMark   hm_inner;
 128     ResourceMark rm_inner;
 129     for (; /* break */; ) {
 130       // This will block until there is a task to be gotten.


< prev index next >