Explanation of code design/logic #980
-
Hi @csukuangfj , @pkufool It would be great if someone can explain the idea behind unlocking the mutex before DecodeStreams and locking it afterwards? as per my understanding, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Yes, you are right. Recognizer is thread-safe while OnlineStream is not thread safe. Several threads can use the same recognizer to decode different streams. The lock protects data members such as |
Beta Was this translation helpful? Give feedback.
-
Hi @csukuangfj ,
|
Beta Was this translation helpful? Give feedback.
By the way, from my experience, onnxruntime session is thread-safe when you use CPU.
It is not the case when you use CUDA.