Java Multi threads with OpenCV 3.3.1
Hi.
I have a process for calculate the quantity of colors by width and build a histogram. Work fine!!
When I put this process in 50, 100 or 200 threads, it crash (block) in:
double[] values = mat.get(w,c)
This statment corresponds to native code following:
org.opencv.core.Mat.nGet(JII)
If that code will syncronized, it will work fine again!!
How can I solve this problem without synchronization?
you probably should not use anything like
mat.get(w,c)
at all in your code, this is really slow.rather use calcHist , than doing your own, slow iterations.
writing slow code, and then trying to multithread it is a bad idea...