Ask Your Question
2

Is dft() thread-safe?

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

PhilRoc gravatar image

Hi,

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
1

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

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

Comments

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 -0600 )edit

Question Tools

1 follower

Stats

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

Seen: 388 times

Last updated: Jul 24 '15