public final class Parallel extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Parallel.RunTimings |
static class |
Parallel.Worker<T>
Extend this class for any work.
|
Modifier and Type | Field and Description |
---|---|
static String |
CONFIG_PREFIX |
static int |
NUM_THREADS_DEFAULT |
static String |
NUM_THREADS_KEY |
Modifier and Type | Method and Description |
---|---|
static Parallel.RunTimings |
count(int start,
int end,
int increment,
Parallel.Worker<Integer> baseWorker)
Count and call a worker with each number in [start, end).
|
static Parallel.RunTimings |
count(int start,
int end,
Parallel.Worker<Integer> baseWorker)
Convenience count() that increments by 1.
|
static Parallel.RunTimings |
count(int end,
Parallel.Worker<Integer> baseWorker)
Convenience count() that starts at 0 and increments by 1.
|
static <T> Parallel.RunTimings |
foreach(Iterable<T> work,
Parallel.Worker<T> baseWorker)
Invoke a worker once for each item.
|
static int |
getNumThreads() |
static Object |
getThreadObject(String key) |
static boolean |
hasThreadObject(String key) |
static void |
putThreadObject(String key,
Object value) |
public static final String CONFIG_PREFIX
public static final String NUM_THREADS_KEY
public static final int NUM_THREADS_DEFAULT
public static int getNumThreads()
public static boolean hasThreadObject(String key)
public static Parallel.RunTimings count(int start, int end, int increment, Parallel.Worker<Integer> baseWorker)
public static Parallel.RunTimings count(int start, int end, Parallel.Worker<Integer> baseWorker)
public static Parallel.RunTimings count(int end, Parallel.Worker<Integer> baseWorker)
public static <T> Parallel.RunTimings foreach(Iterable<T> work, Parallel.Worker<T> baseWorker)
Copyright © 2018 University of California, Santa Cruz. All rights reserved.