public class MultiThreadCoordination extends Object
Modifier and Type | Class and Description |
---|---|
class |
MultiThreadCoordination.MultiThreadInfo
info per thread *
|
Modifier and Type | Field and Description |
---|---|
static int |
HIGH_PRIORITY |
Constructor and Description |
---|
MultiThreadCoordination(List<String> barrier_ids,
int baseNbrOfThreads,
int barrierNbrOfThreads,
int timeout,
TimeUnit tu)
C O N S T R U C T O R *
called once per coordination group, when setting it up *
*
|
Modifier and Type | Method and Description |
---|---|
void |
addThread(Thread t)
Called in different thread when setting up worker threads
|
void |
at_call_primitive(MultiThreadCoordination.MultiThreadInfo ti,
String barrier_id,
int casId,
int casResets)
at call primitive:
if a barrier, hold up until enough cohorts, then release all
if not at barrier, wait the thread if shouldWait (pending)
|
static void |
end_of_pipeline() |
static void |
start_of_pipeline()
S T A T I C M E T H O D S INTERFACE WITH PIPELINE EVENTS *
*
Use static weakMap with thread as key to get threadInfo *
- if exists, call instance of this class's equivalent method *
|
public MultiThreadCoordination(List<String> barrier_ids, int baseNbrOfThreads, int barrierNbrOfThreads, int timeout, TimeUnit tu)
barrier_ids
- list of strings of /aaa/bbb/ *
of fully-qualified key names in aggregate chain down to the primitive *
but excluding the primitive name. *
- 2 strings per barrier - the starting key and the ending key *
- ending key can be a non-matching value (e.g. "end") *
which means the barrier section extends thru to the end of the *
pipelinebaseNbrOfThreads
- number of threads to keep active, *
set to manage memory bandwidth, l1/2/3 caching *barrierNbrOfThreads
- number of threads to await at a barrier before releasing *
to get an affinity effect, this number should be larger than the *
baseNbrOfThreads *timeout
- -tu
- -public static void start_of_pipeline()
public static void end_of_pipeline()
public void at_call_primitive(MultiThreadCoordination.MultiThreadInfo ti, String barrier_id, int casId, int casResets)
ti
- -barrier_id
- -casId
- -casResets
- -public void addThread(Thread t)
t
- the worker threadCopyright © 2006–2021 The Apache Software Foundation. All rights reserved.