| Cv2SetNumThreads Method |
OpenCV will try to set the number of threads for the next parallel region.
If threads == 0, OpenCV will disable threading optimizations and run all it's functions
sequentially.Passing threads < 0 will reset threads number to system default. This function must
be called outside of parallel region.
OpenCV will try to run its functions with specified threads number, but some behaviour differs from framework:
- `TBB` - User-defined parallel constructions will run with the same threads number, if another is not specified.If later on user creates his own scheduler, OpenCV will use it.
- `OpenMP` - No special defined behaviour.
- `Concurrency` - If threads == 1, OpenCV will disable threading optimizations and run its functions sequentially.
- `GCD` - Supports only values <= 0.
- `C=` - No special defined behaviour.
Namespace:
OpenCvSharp
Assembly:
OpenCvSharp (in OpenCvSharp.dll) Version: 1.0.0
Syntax public static void SetNumThreads(
int nThreads
)
Public Shared Sub SetNumThreads (
nThreads As Integer
)
public:
static void SetNumThreads(
int nThreads
)
static member SetNumThreads :
nThreads : int -> unit
Parameters
- nThreads
- Type: SystemInt32
Number of threads used by OpenCV.
See Also