Skip to content
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

Library not suitable for multithreaded environment #380

Open
Mas313 opened this issue Sep 1, 2024 · 3 comments
Open

Library not suitable for multithreaded environment #380

Mas313 opened this issue Sep 1, 2024 · 3 comments

Comments

@Mas313
Copy link

Mas313 commented Sep 1, 2024

Hi,
I ran multiple receivers total 4 in 4 threads, with gmskframesyn_execute to demodulate and decode data but no luck. If I ran one thread then results are ok.
Even without a thread if downconverted buffers are passed to gmskframesyn_execute() in series then also library unable to decode anything.
In this case also only one single gmskframesyn_execute() is able to decode with rest commented out.
It means gmskframesyn_execute() is internally not thread safe or else I am missing something.
I did something like this:

gmskframesyn_execute(fs1,shifted1,numSamples);
gmskframesyn_execute(fs2,shifted2,numSamples);
gmskframesyn_execute(fs3,shifted3,numSamples);
gmskframesyn_execute(fs4,shifted4,numSamples);

The callbacks are seperate for each element.
Thanks for the time.

@JayKickliter
Copy link

JayKickliter commented Sep 6, 2024

I don't see anything in the source referencing globals or anything that would make gmskframesync_execute non-reentrant. I suggest running your threaded test case with TSan

@jgaeddert
Copy link
Owner

That's right; the only thing that makes liquid-dsp non thread-safe (AFAIK) is use of the random number generator in the standard c library. Are the different "shifted" inputs with different time offsets? It's hard to know what the source of the problem you're encountering without further detail.

@Mas313
Copy link
Author

Mas313 commented Sep 7, 2024

No, i have in all receivers used nco to downcovert to desired transmitter frequency, each receiver to receive respective only one transmission. There is no use of random number generation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants