Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

is cv::Mat ref counter atomic?

I have global variable cv::Mat a, then I'm trying to read access two different parts of a from 2 different threads using ROI indexing: cv::Rect r; const cv::Mat tile = a(r);. Will this type of access create race conditions if I only do read on tile? In particular, the ref counter in a will increment with each such access, is this counter an atomic variable, won't it create a race condition?