Concurrency in cuda module fails with visual studio (Bug #3824)
Description
I have had trouble using the cuda functions in a multithreaded environment. After some investigation, it appears that the issue comes from the function-scope static members used in cuda_stream.cpp
As specified here, function-scope static initialization is not thread safe:
http://msdn.microsoft.com/en-us/library/vstudio/s1sb61xd(v=vs.120).aspx
I suggest using a file-scope static variable and an excplicit initialization function since we want to defer the execution of the initialization until we need the variable.
I have implemented the changes but since it deals with core functionality of cuda opencv I would like a direct opinion about that.
Associated revisions
Merge pull request #3824 from Milania1:tutorial_hough_lines_fix
History
Updated by Dmitry Retinskiy over 10 years ago
Ernest,
thanks for the suggested correction.
Please put it in the form of pull request (see http://www.code.opencv.org/projects/opencv/wiki/How_to_contribute).
Each pull request is automatically tested and then reviewed before merge.
- Status changed from New to Open
- Category set to gpu (cuda)
- Assignee set to Ernest Galbrun
Updated by Maksim Shabunin over 9 years ago
Issue has been transferred to GitHub: https://github.com/Itseez/opencv/issues/4794