提交 bee8b017 编写于 作者: J jcoomes

6725697: par compact - rename class ChunkData to RegionData

Reviewed-by: iveresov, tonyp
上级 a039f22b
......@@ -146,7 +146,7 @@ void RefProcTaskExecutor::execute(ProcessTask& task)
{
ParallelScavengeHeap* heap = PSParallelCompact::gc_heap();
uint parallel_gc_threads = heap->gc_task_manager()->workers();
ChunkTaskQueueSet* qset = ParCompactionManager::chunk_array();
RegionTaskQueueSet* qset = ParCompactionManager::region_array();
ParallelTaskTerminator terminator(parallel_gc_threads, qset);
GCTaskQueue* q = GCTaskQueue::create();
for(uint i=0; i<parallel_gc_threads; i++) {
......@@ -205,38 +205,38 @@ void StealMarkingTask::do_it(GCTaskManager* manager, uint which) {
}
//
// StealChunkCompactionTask
// StealRegionCompactionTask
//
StealChunkCompactionTask::StealChunkCompactionTask(ParallelTaskTerminator* t) :
_terminator(t) {};
StealRegionCompactionTask::StealRegionCompactionTask(ParallelTaskTerminator* t):
_terminator(t) {}
void StealChunkCompactionTask::do_it(GCTaskManager* manager, uint which) {
void StealRegionCompactionTask::do_it(GCTaskManager* manager, uint which) {
assert(Universe::heap()->is_gc_active(), "called outside gc");
NOT_PRODUCT(TraceTime tm("StealChunkCompactionTask",
NOT_PRODUCT(TraceTime tm("StealRegionCompactionTask",
PrintGCDetails && TraceParallelOldGCTasks, true, gclog_or_tty));
ParCompactionManager* cm =
ParCompactionManager::gc_thread_compaction_manager(which);
// Has to drain stacks first because there may be chunks on
// Has to drain stacks first because there may be regions on
// preloaded onto the stack and this thread may never have
// done a draining task. Are the draining tasks needed?
cm->drain_chunk_stacks();
cm->drain_region_stacks();
size_t chunk_index = 0;
size_t region_index = 0;
int random_seed = 17;
// If we're the termination task, try 10 rounds of stealing before
// setting the termination flag
while(true) {
if (ParCompactionManager::steal(which, &random_seed, chunk_index)) {
PSParallelCompact::fill_and_update_chunk(cm, chunk_index);
cm->drain_chunk_stacks();
if (ParCompactionManager::steal(which, &random_seed, region_index)) {
PSParallelCompact::fill_and_update_region(cm, region_index);
cm->drain_region_stacks();
} else {
if (terminator()->offer_termination()) {
break;
......@@ -249,11 +249,10 @@ void StealChunkCompactionTask::do_it(GCTaskManager* manager, uint which) {
UpdateDensePrefixTask::UpdateDensePrefixTask(
PSParallelCompact::SpaceId space_id,
size_t chunk_index_start,
size_t chunk_index_end) :
_space_id(space_id), _chunk_index_start(chunk_index_start),
_chunk_index_end(chunk_index_end)
{}
size_t region_index_start,
size_t region_index_end) :
_space_id(space_id), _region_index_start(region_index_start),
_region_index_end(region_index_end) {}
void UpdateDensePrefixTask::do_it(GCTaskManager* manager, uint which) {
......@@ -265,8 +264,8 @@ void UpdateDensePrefixTask::do_it(GCTaskManager* manager, uint which) {
PSParallelCompact::update_and_deadwood_in_dense_prefix(cm,
_space_id,
_chunk_index_start,
_chunk_index_end);
_region_index_start,
_region_index_end);
}
void DrainStacksCompactionTask::do_it(GCTaskManager* manager, uint which) {
......@@ -278,6 +277,6 @@ void DrainStacksCompactionTask::do_it(GCTaskManager* manager, uint which) {
ParCompactionManager* cm =
ParCompactionManager::gc_thread_compaction_manager(which);
// Process any chunks already in the compaction managers stacks.
cm->drain_chunk_stacks();
// Process any regions already in the compaction managers stacks.
cm->drain_region_stacks();
}
......@@ -188,18 +188,18 @@ class StealMarkingTask : public GCTask {
};
//
// StealChunkCompactionTask
// StealRegionCompactionTask
//
// This task is used to distribute work to idle threads.
//
class StealChunkCompactionTask : public GCTask {
class StealRegionCompactionTask : public GCTask {
private:
ParallelTaskTerminator* const _terminator;
public:
StealChunkCompactionTask(ParallelTaskTerminator* t);
StealRegionCompactionTask(ParallelTaskTerminator* t);
char* name() { return (char *)"steal-chunk-task"; }
char* name() { return (char *)"steal-region-task"; }
ParallelTaskTerminator* terminator() { return _terminator; }
virtual void do_it(GCTaskManager* manager, uint which);
......@@ -215,15 +215,15 @@ class StealChunkCompactionTask : public GCTask {
class UpdateDensePrefixTask : public GCTask {
private:
PSParallelCompact::SpaceId _space_id;
size_t _chunk_index_start;
size_t _chunk_index_end;
size_t _region_index_start;
size_t _region_index_end;
public:
char* name() { return (char *)"update-dense_prefix-task"; }
UpdateDensePrefixTask(PSParallelCompact::SpaceId space_id,
size_t chunk_index_start,
size_t chunk_index_end);
size_t region_index_start,
size_t region_index_end);
virtual void do_it(GCTaskManager* manager, uint which);
};
......@@ -231,17 +231,17 @@ class UpdateDensePrefixTask : public GCTask {
//
// DrainStacksCompactionTask
//
// This task processes chunks that have been added to the stacks of each
// This task processes regions that have been added to the stacks of each
// compaction manager.
//
// Trying to use one draining thread does not work because there are no
// guarantees about which task will be picked up by which thread. For example,
// if thread A gets all the preloaded chunks, thread A may not get a draining
// if thread A gets all the preloaded regions, thread A may not get a draining
// task (they may all be done by other threads).
//
class DrainStacksCompactionTask : public GCTask {
public:
char* name() { return (char *)"drain-chunk-task"; }
char* name() { return (char *)"drain-region-task"; }
virtual void do_it(GCTaskManager* manager, uint which);
};
......@@ -30,7 +30,7 @@ ParCompactionManager** ParCompactionManager::_manager_array = NULL;
OopTaskQueueSet* ParCompactionManager::_stack_array = NULL;
ObjectStartArray* ParCompactionManager::_start_array = NULL;
ParMarkBitMap* ParCompactionManager::_mark_bitmap = NULL;
ChunkTaskQueueSet* ParCompactionManager::_chunk_array = NULL;
RegionTaskQueueSet* ParCompactionManager::_region_array = NULL;
ParCompactionManager::ParCompactionManager() :
_action(CopyAndUpdate) {
......@@ -46,13 +46,13 @@ ParCompactionManager::ParCompactionManager() :
// We want the overflow stack to be permanent
_overflow_stack = new (ResourceObj::C_HEAP) GrowableArray<oop>(10, true);
#ifdef USE_ChunkTaskQueueWithOverflow
chunk_stack()->initialize();
#ifdef USE_RegionTaskQueueWithOverflow
region_stack()->initialize();
#else
chunk_stack()->initialize();
region_stack()->initialize();
// We want the overflow stack to be permanent
_chunk_overflow_stack =
_region_overflow_stack =
new (ResourceObj::C_HEAP) GrowableArray<size_t>(10, true);
#endif
......@@ -86,18 +86,18 @@ void ParCompactionManager::initialize(ParMarkBitMap* mbm) {
_stack_array = new OopTaskQueueSet(parallel_gc_threads);
guarantee(_stack_array != NULL, "Count not initialize promotion manager");
_chunk_array = new ChunkTaskQueueSet(parallel_gc_threads);
guarantee(_chunk_array != NULL, "Count not initialize promotion manager");
_region_array = new RegionTaskQueueSet(parallel_gc_threads);
guarantee(_region_array != NULL, "Count not initialize promotion manager");
// Create and register the ParCompactionManager(s) for the worker threads.
for(uint i=0; i<parallel_gc_threads; i++) {
_manager_array[i] = new ParCompactionManager();
guarantee(_manager_array[i] != NULL, "Could not create ParCompactionManager");
stack_array()->register_queue(i, _manager_array[i]->marking_stack());
#ifdef USE_ChunkTaskQueueWithOverflow
chunk_array()->register_queue(i, _manager_array[i]->chunk_stack()->task_queue());
#ifdef USE_RegionTaskQueueWithOverflow
region_array()->register_queue(i, _manager_array[i]->region_stack()->task_queue());
#else
chunk_array()->register_queue(i, _manager_array[i]->chunk_stack());
region_array()->register_queue(i, _manager_array[i]->region_stack());
#endif
}
......@@ -153,31 +153,31 @@ oop ParCompactionManager::retrieve_for_scanning() {
return NULL;
}
// Save chunk on a stack
void ParCompactionManager::save_for_processing(size_t chunk_index) {
// Save region on a stack
void ParCompactionManager::save_for_processing(size_t region_index) {
#ifdef ASSERT
const ParallelCompactData& sd = PSParallelCompact::summary_data();
ParallelCompactData::ChunkData* const chunk_ptr = sd.chunk(chunk_index);
assert(chunk_ptr->claimed(), "must be claimed");
assert(chunk_ptr->_pushed++ == 0, "should only be pushed once");
ParallelCompactData::RegionData* const region_ptr = sd.region(region_index);
assert(region_ptr->claimed(), "must be claimed");
assert(region_ptr->_pushed++ == 0, "should only be pushed once");
#endif
chunk_stack_push(chunk_index);
region_stack_push(region_index);
}
void ParCompactionManager::chunk_stack_push(size_t chunk_index) {
void ParCompactionManager::region_stack_push(size_t region_index) {
#ifdef USE_ChunkTaskQueueWithOverflow
chunk_stack()->save(chunk_index);
#ifdef USE_RegionTaskQueueWithOverflow
region_stack()->save(region_index);
#else
if(!chunk_stack()->push(chunk_index)) {
chunk_overflow_stack()->push(chunk_index);
if(!region_stack()->push(region_index)) {
region_overflow_stack()->push(region_index);
}
#endif
}
bool ParCompactionManager::retrieve_for_processing(size_t& chunk_index) {
#ifdef USE_ChunkTaskQueueWithOverflow
return chunk_stack()->retrieve(chunk_index);
bool ParCompactionManager::retrieve_for_processing(size_t& region_index) {
#ifdef USE_RegionTaskQueueWithOverflow
return region_stack()->retrieve(region_index);
#else
// Should not be used in the parallel case
ShouldNotReachHere();
......@@ -230,14 +230,14 @@ void ParCompactionManager::drain_marking_stacks(OopClosure* blk) {
assert(overflow_stack()->length() == 0, "Sanity");
}
void ParCompactionManager::drain_chunk_overflow_stack() {
size_t chunk_index = (size_t) -1;
while(chunk_stack()->retrieve_from_overflow(chunk_index)) {
PSParallelCompact::fill_and_update_chunk(this, chunk_index);
void ParCompactionManager::drain_region_overflow_stack() {
size_t region_index = (size_t) -1;
while(region_stack()->retrieve_from_overflow(region_index)) {
PSParallelCompact::fill_and_update_region(this, region_index);
}
}
void ParCompactionManager::drain_chunk_stacks() {
void ParCompactionManager::drain_region_stacks() {
#ifdef ASSERT
ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap();
assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity");
......@@ -249,42 +249,42 @@ void ParCompactionManager::drain_chunk_stacks() {
#if 1 // def DO_PARALLEL - the serial code hasn't been updated
do {
#ifdef USE_ChunkTaskQueueWithOverflow
#ifdef USE_RegionTaskQueueWithOverflow
// Drain overflow stack first, so other threads can steal from
// claimed stack while we work.
size_t chunk_index = (size_t) -1;
while(chunk_stack()->retrieve_from_overflow(chunk_index)) {
PSParallelCompact::fill_and_update_chunk(this, chunk_index);
size_t region_index = (size_t) -1;
while(region_stack()->retrieve_from_overflow(region_index)) {
PSParallelCompact::fill_and_update_region(this, region_index);
}
while (chunk_stack()->retrieve_from_stealable_queue(chunk_index)) {
PSParallelCompact::fill_and_update_chunk(this, chunk_index);
while (region_stack()->retrieve_from_stealable_queue(region_index)) {
PSParallelCompact::fill_and_update_region(this, region_index);
}
} while (!chunk_stack()->is_empty());
} while (!region_stack()->is_empty());
#else
// Drain overflow stack first, so other threads can steal from
// claimed stack while we work.
while(!chunk_overflow_stack()->is_empty()) {
size_t chunk_index = chunk_overflow_stack()->pop();
PSParallelCompact::fill_and_update_chunk(this, chunk_index);
while(!region_overflow_stack()->is_empty()) {
size_t region_index = region_overflow_stack()->pop();
PSParallelCompact::fill_and_update_region(this, region_index);
}
size_t chunk_index = -1;
size_t region_index = -1;
// obj is a reference!!!
while (chunk_stack()->pop_local(chunk_index)) {
while (region_stack()->pop_local(region_index)) {
// It would be nice to assert about the type of objects we might
// pop, but they can come from anywhere, unfortunately.
PSParallelCompact::fill_and_update_chunk(this, chunk_index);
PSParallelCompact::fill_and_update_region(this, region_index);
}
} while((chunk_stack()->size() != 0) ||
(chunk_overflow_stack()->length() != 0));
} while((region_stack()->size() != 0) ||
(region_overflow_stack()->length() != 0));
#endif
#ifdef USE_ChunkTaskQueueWithOverflow
assert(chunk_stack()->is_empty(), "Sanity");
#ifdef USE_RegionTaskQueueWithOverflow
assert(region_stack()->is_empty(), "Sanity");
#else
assert(chunk_stack()->size() == 0, "Sanity");
assert(chunk_overflow_stack()->length() == 0, "Sanity");
assert(region_stack()->size() == 0, "Sanity");
assert(region_overflow_stack()->length() == 0, "Sanity");
#endif
#else
oop obj;
......
......@@ -52,7 +52,7 @@ class ParCompactionManager : public CHeapObj {
friend class ParallelTaskTerminator;
friend class ParMarkBitMap;
friend class PSParallelCompact;
friend class StealChunkCompactionTask;
friend class StealRegionCompactionTask;
friend class UpdateAndFillClosure;
friend class RefProcTaskExecutor;
......@@ -75,20 +75,20 @@ class ParCompactionManager : public CHeapObj {
static ParCompactionManager** _manager_array;
static OopTaskQueueSet* _stack_array;
static ObjectStartArray* _start_array;
static ChunkTaskQueueSet* _chunk_array;
static RegionTaskQueueSet* _region_array;
static PSOldGen* _old_gen;
OopTaskQueue _marking_stack;
GrowableArray<oop>* _overflow_stack;
// Is there a way to reuse the _marking_stack for the
// saving empty chunks? For now just create a different
// saving empty regions? For now just create a different
// type of TaskQueue.
#ifdef USE_ChunkTaskQueueWithOverflow
ChunkTaskQueueWithOverflow _chunk_stack;
#ifdef USE_RegionTaskQueueWithOverflow
RegionTaskQueueWithOverflow _region_stack;
#else
ChunkTaskQueue _chunk_stack;
GrowableArray<size_t>* _chunk_overflow_stack;
RegionTaskQueue _region_stack;
GrowableArray<size_t>* _region_overflow_stack;
#endif
#if 1 // does this happen enough to need a per thread stack?
......@@ -106,15 +106,16 @@ class ParCompactionManager : public CHeapObj {
protected:
// Array of tasks. Needed by the ParallelTaskTerminator.
static ChunkTaskQueueSet* chunk_array() { return _chunk_array; }
static RegionTaskQueueSet* region_array() { return _region_array; }
OopTaskQueue* marking_stack() { return &_marking_stack; }
GrowableArray<oop>* overflow_stack() { return _overflow_stack; }
#ifdef USE_ChunkTaskQueueWithOverflow
ChunkTaskQueueWithOverflow* chunk_stack() { return &_chunk_stack; }
#ifdef USE_RegionTaskQueueWithOverflow
RegionTaskQueueWithOverflow* region_stack() { return &_region_stack; }
#else
ChunkTaskQueue* chunk_stack() { return &_chunk_stack; }
GrowableArray<size_t>* chunk_overflow_stack() { return _chunk_overflow_stack; }
RegionTaskQueue* region_stack() { return &_region_stack; }
GrowableArray<size_t>* region_overflow_stack() {
return _region_overflow_stack;
}
#endif
// Pushes onto the marking stack. If the marking stack is full,
......@@ -123,9 +124,9 @@ class ParCompactionManager : public CHeapObj {
// Do not implement an equivalent stack_pop. Deal with the
// marking stack and overflow stack directly.
// Pushes onto the chunk stack. If the chunk stack is full,
// pushes onto the chunk overflow stack.
void chunk_stack_push(size_t chunk_index);
// Pushes onto the region stack. If the region stack is full,
// pushes onto the region overflow stack.
void region_stack_push(size_t region_index);
public:
Action action() { return _action; }
......@@ -160,10 +161,10 @@ class ParCompactionManager : public CHeapObj {
// Get a oop for scanning. If returns null, no oop were found.
oop retrieve_for_scanning();
// Save chunk for later processing. Must not fail.
void save_for_processing(size_t chunk_index);
// Get a chunk for processing. If returns null, no chunk were found.
bool retrieve_for_processing(size_t& chunk_index);
// Save region for later processing. Must not fail.
void save_for_processing(size_t region_index);
// Get a region for processing. If returns null, no region were found.
bool retrieve_for_processing(size_t& region_index);
// Access function for compaction managers
static ParCompactionManager* gc_thread_compaction_manager(int index);
......@@ -172,18 +173,18 @@ class ParCompactionManager : public CHeapObj {
return stack_array()->steal(queue_num, seed, t);
}
static bool steal(int queue_num, int* seed, ChunkTask& t) {
return chunk_array()->steal(queue_num, seed, t);
static bool steal(int queue_num, int* seed, RegionTask& t) {
return region_array()->steal(queue_num, seed, t);
}
// Process tasks remaining on any stack
void drain_marking_stacks(OopClosure *blk);
// Process tasks remaining on any stack
void drain_chunk_stacks();
void drain_region_stacks();
// Process tasks remaining on any stack
void drain_chunk_overflow_stack();
void drain_region_overflow_stack();
// Debugging support
#ifdef ASSERT
......
......@@ -1157,9 +1157,9 @@ class CommandLineFlags {
"In the Parallel Old garbage collector use parallel dense" \
" prefix update") \
\
develop(bool, UseParallelOldGCChunkPointerCalc, true, \
"In the Parallel Old garbage collector use chucks to calculate" \
" new object locations") \
develop(bool, UseParallelOldGCRegionPointerCalc, true, \
"In the Parallel Old garbage collector use regions to calculate" \
"new object locations") \
\
product(uintx, HeapMaximumCompactionInterval, 20, \
"How often should we maximally compact the heap (not allowing " \
......@@ -1195,8 +1195,8 @@ class CommandLineFlags {
develop(bool, ParallelOldMTUnsafeUpdateLiveData, false, \
"Use the Parallel Old MT unsafe in update of live size") \
\
develop(bool, TraceChunkTasksQueuing, false, \
"Trace the queuing of the chunk tasks") \
develop(bool, TraceRegionTasksQueuing, false, \
"Trace the queuing of the region tasks") \
\
product(uintx, ParallelMarkingThreads, 0, \
"Number of marking threads concurrent gc will use") \
......
......@@ -109,72 +109,72 @@ void ParallelTaskTerminator::reset_for_reuse() {
}
}
bool ChunkTaskQueueWithOverflow::is_empty() {
return (_chunk_queue.size() == 0) &&
bool RegionTaskQueueWithOverflow::is_empty() {
return (_region_queue.size() == 0) &&
(_overflow_stack->length() == 0);
}
bool ChunkTaskQueueWithOverflow::stealable_is_empty() {
return _chunk_queue.size() == 0;
bool RegionTaskQueueWithOverflow::stealable_is_empty() {
return _region_queue.size() == 0;
}
bool ChunkTaskQueueWithOverflow::overflow_is_empty() {
bool RegionTaskQueueWithOverflow::overflow_is_empty() {
return _overflow_stack->length() == 0;
}
void ChunkTaskQueueWithOverflow::initialize() {
_chunk_queue.initialize();
void RegionTaskQueueWithOverflow::initialize() {
_region_queue.initialize();
assert(_overflow_stack == 0, "Creating memory leak");
_overflow_stack =
new (ResourceObj::C_HEAP) GrowableArray<ChunkTask>(10, true);
new (ResourceObj::C_HEAP) GrowableArray<RegionTask>(10, true);
}
void ChunkTaskQueueWithOverflow::save(ChunkTask t) {
if (TraceChunkTasksQueuing && Verbose) {
void RegionTaskQueueWithOverflow::save(RegionTask t) {
if (TraceRegionTasksQueuing && Verbose) {
gclog_or_tty->print_cr("CTQ: save " PTR_FORMAT, t);
}
if(!_chunk_queue.push(t)) {
if(!_region_queue.push(t)) {
_overflow_stack->push(t);
}
}
// Note that using this method will retrieve all chunks
// Note that using this method will retrieve all regions
// that have been saved but that it will always check
// the overflow stack. It may be more efficient to
// check the stealable queue and the overflow stack
// separately.
bool ChunkTaskQueueWithOverflow::retrieve(ChunkTask& chunk_task) {
bool result = retrieve_from_overflow(chunk_task);
bool RegionTaskQueueWithOverflow::retrieve(RegionTask& region_task) {
bool result = retrieve_from_overflow(region_task);
if (!result) {
result = retrieve_from_stealable_queue(chunk_task);
result = retrieve_from_stealable_queue(region_task);
}
if (TraceChunkTasksQueuing && Verbose && result) {
if (TraceRegionTasksQueuing && Verbose && result) {
gclog_or_tty->print_cr(" CTQ: retrieve " PTR_FORMAT, result);
}
return result;
}
bool ChunkTaskQueueWithOverflow::retrieve_from_stealable_queue(
ChunkTask& chunk_task) {
bool result = _chunk_queue.pop_local(chunk_task);
if (TraceChunkTasksQueuing && Verbose) {
gclog_or_tty->print_cr("CTQ: retrieve_stealable " PTR_FORMAT, chunk_task);
bool RegionTaskQueueWithOverflow::retrieve_from_stealable_queue(
RegionTask& region_task) {
bool result = _region_queue.pop_local(region_task);
if (TraceRegionTasksQueuing && Verbose) {
gclog_or_tty->print_cr("CTQ: retrieve_stealable " PTR_FORMAT, region_task);
}
return result;
}
bool ChunkTaskQueueWithOverflow::retrieve_from_overflow(
ChunkTask& chunk_task) {
bool
RegionTaskQueueWithOverflow::retrieve_from_overflow(RegionTask& region_task) {
bool result;
if (!_overflow_stack->is_empty()) {
chunk_task = _overflow_stack->pop();
region_task = _overflow_stack->pop();
result = true;
} else {
chunk_task = (ChunkTask) NULL;
region_task = (RegionTask) NULL;
result = false;
}
if (TraceChunkTasksQueuing && Verbose) {
gclog_or_tty->print_cr("CTQ: retrieve_stealable " PTR_FORMAT, chunk_task);
if (TraceRegionTasksQueuing && Verbose) {
gclog_or_tty->print_cr("CTQ: retrieve_stealable " PTR_FORMAT, region_task);
}
return result;
}
......@@ -557,32 +557,32 @@ class StarTask {
typedef GenericTaskQueue<StarTask> OopStarTaskQueue;
typedef GenericTaskQueueSet<StarTask> OopStarTaskQueueSet;
typedef size_t ChunkTask; // index for chunk
typedef GenericTaskQueue<ChunkTask> ChunkTaskQueue;
typedef GenericTaskQueueSet<ChunkTask> ChunkTaskQueueSet;
typedef size_t RegionTask; // index for region
typedef GenericTaskQueue<RegionTask> RegionTaskQueue;
typedef GenericTaskQueueSet<RegionTask> RegionTaskQueueSet;
class ChunkTaskQueueWithOverflow: public CHeapObj {
class RegionTaskQueueWithOverflow: public CHeapObj {
protected:
ChunkTaskQueue _chunk_queue;
GrowableArray<ChunkTask>* _overflow_stack;
RegionTaskQueue _region_queue;
GrowableArray<RegionTask>* _overflow_stack;
public:
ChunkTaskQueueWithOverflow() : _overflow_stack(NULL) {}
RegionTaskQueueWithOverflow() : _overflow_stack(NULL) {}
// Initialize both stealable queue and overflow
void initialize();
// Save first to stealable queue and then to overflow
void save(ChunkTask t);
void save(RegionTask t);
// Retrieve first from overflow and then from stealable queue
bool retrieve(ChunkTask& chunk_index);
bool retrieve(RegionTask& region_index);
// Retrieve from stealable queue
bool retrieve_from_stealable_queue(ChunkTask& chunk_index);
bool retrieve_from_stealable_queue(RegionTask& region_index);
// Retrieve from overflow
bool retrieve_from_overflow(ChunkTask& chunk_index);
bool retrieve_from_overflow(RegionTask& region_index);
bool is_empty();
bool stealable_is_empty();
bool overflow_is_empty();
juint stealable_size() { return _chunk_queue.size(); }
ChunkTaskQueue* task_queue() { return &_chunk_queue; }
juint stealable_size() { return _region_queue.size(); }
RegionTaskQueue* task_queue() { return &_region_queue; }
};
#define USE_ChunkTaskQueueWithOverflow
#define USE_RegionTaskQueueWithOverflow
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册