440 return (uint) -1; // Why isn't there a max_uint?
441 }
442
443 // Execute the task queue and wait for the completion.
444 void execute_and_wait(GCTaskQueue* list);
445
446 void print_task_time_stamps();
447 void print_threads_on(outputStream* st);
448 void threads_do(ThreadClosure* tc);
449
450 protected:
451 // Constructors. Clients use factory, but there might be subclasses.
452 // Create a GCTaskManager with the appropriate number of workers.
453 GCTaskManager(uint workers);
454 // Make virtual if necessary.
455 ~GCTaskManager();
456 // Accessors.
457 uint workers() const {
458 return _workers;
459 }
460 void set_active_workers(uint v) {
461 assert(v <= _workers, "Trying to set more workers active than there are");
462 _active_workers = MIN2(v, _workers);
463 assert(v != 0, "Trying to set active workers to 0");
464 _active_workers = MAX2(1U, _active_workers);
465 }
466 // Sets the number of threads that will be used in a collection
467 void set_active_gang();
468
469 SynchronizedGCTaskQueue* queue() const {
470 return _queue;
471 }
472 NoopGCTask* noop_task() const {
473 return _noop_task;
474 }
475 // Bounds-checking per-thread data accessors.
476 GCTaskThread* thread(uint which);
477 void set_thread(uint which, GCTaskThread* value);
478 bool resource_flag(uint which);
479 void set_resource_flag(uint which, bool value);
480 // Modifier methods with some semantics.
481 // Is any worker blocking handing out new tasks?
482 uint blocking_worker() const {
483 return _blocking_worker;
484 }
|
440 return (uint) -1; // Why isn't there a max_uint?
441 }
442
443 // Execute the task queue and wait for the completion.
444 void execute_and_wait(GCTaskQueue* list);
445
446 void print_task_time_stamps();
447 void print_threads_on(outputStream* st);
448 void threads_do(ThreadClosure* tc);
449
450 protected:
451 // Constructors. Clients use factory, but there might be subclasses.
452 // Create a GCTaskManager with the appropriate number of workers.
453 GCTaskManager(uint workers);
454 // Make virtual if necessary.
455 ~GCTaskManager();
456 // Accessors.
457 uint workers() const {
458 return _workers;
459 }
460 uint update_active_workers(uint v) {
461 assert(v <= _workers, "Trying to set more workers active than there are");
462 _active_workers = MIN2(v, _workers);
463 assert(v != 0, "Trying to set active workers to 0");
464 _active_workers = MAX2(1U, _active_workers);
465 return _active_workers;
466 }
467 // Sets the number of threads that will be used in a collection
468 void set_active_gang();
469
470 SynchronizedGCTaskQueue* queue() const {
471 return _queue;
472 }
473 NoopGCTask* noop_task() const {
474 return _noop_task;
475 }
476 // Bounds-checking per-thread data accessors.
477 GCTaskThread* thread(uint which);
478 void set_thread(uint which, GCTaskThread* value);
479 bool resource_flag(uint which);
480 void set_resource_flag(uint which, bool value);
481 // Modifier methods with some semantics.
482 // Is any worker blocking handing out new tasks?
483 uint blocking_worker() const {
484 return _blocking_worker;
485 }
|