core: fix pthreads performance
authorAlexander Alekhin <alexander.alekhin@intel.com>
Fri, 19 Jan 2018 14:26:29 +0000 (17:26 +0300)
committerAlexander Alekhin <alexander.a.alekhin@gmail.com>
Fri, 26 Jan 2018 04:09:11 +0000 (04:09 +0000)
commitc49d5d5252dd13a706cd2f01e6afc3dac083bdbd
tree7ceca3ab89aa84682bbd996f535982f0f24ae734
parent47998c03f8008d4b5c140e51aa20053d0449a126
core: fix pthreads performance

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)
modules/core/include/opencv2/core/utility.hpp
modules/core/src/parallel.cpp
modules/core/src/parallel_impl.cpp [new file with mode: 0644]
modules/core/src/parallel_impl.hpp [new file with mode: 0644]
modules/core/src/parallel_pthreads.cpp [deleted file]