tazz4843 / coqui-stt

Safe wrapper around the Coqui STT C library
108 stars 9 forks source link

Stream isn't Send/Sync? #4

Closed goose121 closed 2 years ago

goose121 commented 2 years ago

I noticed that Send and Sync impls were removed from Stream, with the comment that they were unsafe, however looking at the source code for libstt it doesn't seem to be doing anything that would prevent them from being Send or Sync. The closest I could find was a thread in the discussions for STT about a segfault another developer was having, but they mentioned using a mutex to fix the issue on Android, so this seems like more of an issue of improper management of shared mutable state than a fundamental lack of thread safety in Stream. Is there another reason why Stream can't be shared between threads even with proper synchronization?

tazz4843 commented 2 years ago

I've never found any real source for whether Stream was threadsafe, so I was basing that off a thread on the DeepSpeech discourse forum. If it's 100% certain that Stream is actually threadsafe, I'd be happy to add it back in.

https://discourse.mozilla.org/t/is-deepspeech-nativeclient-thread-safe/38801

tazz4843 commented 2 years ago

Gonna close this as it's been two weeks now. Feel free to reopen this at any time if you'd like to clarify something.