Ask Your Question

Is dft() thread-safe?

asked 2015-07-24 09:27:18 -0500

PhilRoc gravatar image


I'm having some issues with dft() giving back arrays filled with NaN when called in a multi-threaded environment (tbb::parallel_for). The same code produces valid results when called in a sequential for loop. I know FFTW is not thread-safe, is OpenCV's DFT also not thread-safe?

Thanks, Phil

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2015-07-24 10:58:19 -0500

PhilRoc gravatar image

I think I can answer my own question. I can't say for sure whether dft() is entirely thread-safe, but it does look like you can call dft() in a tbb::parallel_for loop. I had some caching issues buried elsewhere in my code that were leading to the NaN's being introduced in the multi-threaded case.

edit flag offensive delete link more


Maybe you can add some minimal example code as other people could test and have a look into the code.

Eduardo gravatar imageEduardo ( 2015-07-25 16:50:24 -0500 )edit

Question Tools

1 follower


Asked: 2015-07-24 09:27:18 -0500

Seen: 267 times

Last updated: Jul 24 '15