Closed goose121 closed 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
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.
I noticed that
Send
andSync
impls were removed fromStream
, with the comment that they were unsafe, however looking at the source code forlibstt
it doesn't seem to be doing anything that would prevent them from beingSend
orSync
. The closest I could find was a thread in the discussions forSTT
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 inStream
. Is there another reason whyStream
can't be shared between threads even with proper synchronization?