![]() The printed time spans are staying constant. The behavior of the program I would expect is that the time spans are staying pretty much constant, even tho they might be longer than calling the function directly. High_resolution_clock::time_point start = high_resolution_clock::now() įor (int k = 0 k (end - start).count() (end - start).count() << endl Īfter running the program for around 10 minutes the printed timespans have doubled, which is not explainable with normal fluctuations. Unafilliated with the OpenArena team, this project allows playing the game completely within the browser. Again, VERY limited test, who knows what bugs will pop up with more intense gameplay. OpenArena is a free clone of the famous FPS Quake III Arena. ![]() But I encountered strange performance problems when running my program for longer time periods.Īfter investigating these performance problems I created this minimal, complete, and verifiable example code: #include "opencv2\opencv.hpp" Those are rough averages as the FPS counter jumps all over the place but it's clearly an improvement. So I thought it was at least okay to use (multi)threading on application level. The library itself is thread safe in that you can have multiple calls into the library at the same time, however the data is not always thread safe. Rather rebuild the opencv libs with TBB or openmp support.īut another answer with 3 upvotes is stating: a lot of functions are explicitly not thread-safe. Please avoid using your own multithreading with opencv. Regarding multithreading on application level, an comment from an moderator on : OpenCV philosophy here is that application should be multi-threaded, not OpenCV functions. The problem is that just a handsome of function are threaded with TBB at the moment (may be a dozen). On an SMP system you can even see kernel threads running concurrently on separate CPUs. With WITH_TBB=ON OpenCV tries to use several threads for some functions. The header shall define the following compile-time constant expressions valid as initializers for the following types: Name.![]() Regarding TBB, an answer from 2012 with 5 upvotes: Open the Software Center, go to the Games category, go to the Arcade subcategory and choose OpenArena. On the other hand you can create multiple threads yourself and call the functions parallel to realize multithreading on application level.īut I couldn't get consistent answers which method of multithreading is the right way to go.On the one hand you can build OpenCV with TBB or OpenMP support which parallelize OpenCV's functions internally.I read some articles and posts regarding Multithreading in OpenCV:
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |