-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FFT Window Threadsafety #7145
FFT Window Threadsafety #7145
Conversation
3199bf0
to
85b437c
Compare
ff7844d
to
2840a0c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good to me, but performance-wise I'm wondering if it wouldn't be better to get the window lock at the beginning of the work()
function and hold it for the whole duration of work()
. I'm slightly worried that if the FFT size is small, locking and unlocking the mutex for each individual FFT might introduce too much overhead.
This comment was marked as resolved.
This comment was marked as resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tend to agree with @daniestevez, although I don't know about the performance overhead. But what if we flip it around: If we unlock sooner, we get better concurrency. To which I say "so what", what's the value of being able to call set_window()
more often from a different thread. So if we lock for the duration of work()
, we get maybe some, maybe very little performance gains, but we lose nothing of value.
@mbr0wn that's exactly what I had in mind. |
I'm fine either way, but I remember I had to be finer in locking granularity in one place, because otherwise I could deadlock our CI, then made it consistent in every place. Will have to check what the precise reason was, and whether it affects work, probably not. Anyways, currently no time, so this becomes a draft for now. |
e4f22d4
to
3512b07
Compare
Signed-off-by: Marcus Müller <mmueller@gnuradio.org>
…antics Also, remove unused config.h Signed-off-by: Marcus Müller <mmueller@gnuradio.org>
Signed-off-by: Marcus Müller <mmueller@gnuradio.org>
3512b07
to
8b26c19
Compare
Description
I add locks around window setting/usage.
As a drive-by improvement, let's not use floor, ceil to implement (inherent) integer division semantics.
Related Issue
Fixes #7144
Which blocks/areas does this affect?
FFT
Testing Done
Checklist