< prev index next >

src/share/vm/gc/parallel/gcTaskManager.hpp

Print this page
rev 10651 : 6858051: Create GC worker threads dynamically
Reviewed-by:

@@ -368,10 +368,11 @@
   // Instance state.
   const uint                _workers;           // Number of workers.
   Monitor*                  _monitor;           // Notification of changes.
   SynchronizedGCTaskQueue*  _queue;             // Queue of tasks.
   GCTaskThread**            _thread;            // Array of worker threads.
+  uint                      _created_workers;   // Number of workers created.
   uint                      _active_workers;    // Number of active workers.
   uint                      _busy_workers;      // Number of busy workers.
   uint                      _blocking_worker;   // The worker that's blocking.
   bool*                     _resource_flag;     // Array of flag per threads.
   uint                      _delivered_tasks;   // Count of delivered tasks.

@@ -379,10 +380,12 @@
   uint                      _barriers;          // Count of barrier tasks.
   uint                      _emptied_queue;     // Times we emptied the queue.
   NoopGCTask*               _noop_task;         // The NoopGCTask instance.
   WaitHelper                _wait_helper;       // Used by inactive worker
   volatile uint             _idle_workers;      // Number of idled workers
+  uint*                     _processor_assignment; // Worker to cpu mappings. May
+                                                   // be used lazily
 public:
   // Factory create and destroy methods.
   static GCTaskManager* create(uint workers) {
     return new GCTaskManager(workers);
   }

@@ -544,10 +547,17 @@
   // Return true if all workers are currently active.
   bool all_workers_active() { return workers() == active_workers(); }
   uint active_workers() const {
     return _active_workers;
   }
+  uint created_workers() const {
+    return _created_workers;
+  }
+  // Create a GC worker and install into GCTaskManager
+  GCTaskThread* install_worker(uint worker_id);
+  // Add GC workers as needed.
+  bool add_workers(bool initializing);
 };
 
 //
 // Some exemplary GCTasks.
 //
< prev index next >