Package boofcv.concurrency
Class BoofConcurrency
java.lang.Object
pabeles.concurrency.ConcurrencyOps
boofcv.concurrency.BoofConcurrency
Central class for controlling concurrency in BoofCV.
-
Nested Class Summary
Nested classes/interfaces inherited from class pabeles.concurrency.ConcurrencyOps
ConcurrencyOps.NewInstance<D extends Object>, ConcurrencyOps.Reset<D extends Object>
-
Field Summary
Modifier and TypeFieldDescriptionstatic int
If an image has fewer pixels than this it will not run a concurrent algorithm.static boolean
f set to true it will use a concurrent algorithm -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
Either returns the number of threads in the thread pool or one if threading is disabledstatic boolean
static void
setMaxThreads
(int maxThreads) Sets the maximum number of threads available in the thread pool and adjusts USE_CONCURRENT.Methods inherited from class pabeles.concurrency.ConcurrencyOps
getMaxThreads, getThreadPool, loopBlocks, loopBlocks, loopBlocks, loopBlocks, loopFor, loopFor, loopFor, max, min, sum
-
Field Details
-
SMALL_IMAGE
public static int SMALL_IMAGEIf an image has fewer pixels than this it will not run a concurrent algorithm. The overhead makes it slower. -
USE_CONCURRENT
public static boolean USE_CONCURRENTf set to true it will use a concurrent algorithm
-
-
Constructor Details
-
BoofConcurrency
public BoofConcurrency()
-
-
Method Details
-
setMaxThreads
public static void setMaxThreads(int maxThreads) Sets the maximum number of threads available in the thread pool and adjusts USE_CONCURRENT. If the number of threads is less than 2 then USE_CONCURRENT will be set to false and the single thread version of code will be called. Otherwise USE_CONCURRENT will be true and the max threads in the pool set to the specified number.- Parameters:
maxThreads
- Maximum number of threads. &le 1 means it will not be threaded.
-
isUseConcurrent
public static boolean isUseConcurrent() -
getEffectiveActiveThreads
public static int getEffectiveActiveThreads()Either returns the number of threads in the thread pool or one if threading is disabled
-