rust-math/fftw

Can plan executions take &self instead of &mut self?

dodomorandi opened this issue · 4 comments

I am asking this, because I am having a hard time trying to check whether this is possible or not. According to this documentation, execution of plans should take a const pointer to the plan (which AFAIK is nearly meaningless in the C world, because you are totally safe (ahem) to change nested values...).

Maybe it could be possible, but I am completely unable to hack through the code of FFTW3 to find the answer by myself. I could not find a similar question, therefore, even if c2c/r2c/c2r really need to use &mut self, at least there is an issue explicitly discussing this.

miili commented

Yes this should definitely work!

miili commented

Implemented in #117

I'm attempting to do this, but getting the error that,

| |_________^ `*mut fftw_sys::fftw_plan_s` cannot be shared between threads safely

As plans don't implement Sync, required by rayon's parallel iterator

Edit, Oh I see it hasn't been merged into master, are there any plans to do this?

miili commented

I'd hope! The repo unfortunately looks unmaintained...