mirror of
https://github.com/opencv/opencv.git
synced 2024-12-15 18:09:11 +08:00
c49d5d5252
OpenCV pthreads-based implementation changes: - rework worker threads pool, allow to execute job by the main thread too - rework synchronization scheme (wait for job completion, threads 'pong' answer is not required) - allow "active wait" (spin) by worker threads and by the main thread - use _mm_pause() during active wait (support for Hyper-Threading technology) - use sched_yield() to avoid preemption of still working other workers - don't use getTickCount() - optional builtin thread pool profiler (disabled by compilation flag)
18 lines
555 B
C++
18 lines
555 B
C++
// This file is part of OpenCV project.
|
|
// It is subject to the license terms in the LICENSE file found in the top-level directory
|
|
// of this distribution and at http://opencv.org/license.html.
|
|
#ifndef OPENCV_CORE_PARALLEL_IMPL_HPP
|
|
#define OPENCV_CORE_PARALLEL_IMPL_HPP
|
|
|
|
namespace cv {
|
|
|
|
unsigned defaultNumberOfThreads();
|
|
|
|
void parallel_for_pthreads(const Range& range, const ParallelLoopBody& body, double nstripes);
|
|
size_t parallel_pthreads_get_threads_num();
|
|
void parallel_pthreads_set_threads_num(int num);
|
|
|
|
}
|
|
|
|
#endif // OPENCV_CORE_PARALLEL_IMPL_HPP
|