Re: 回复: 回复: 回复: (no subject )
Steve Checkoway <[email protected]> Wed, 7 Dec 2011 01:48:37 -0800
| Newsgroups | gmane.comp.audio.compression.speex.devel |
|---|---|
| Message-ID | <[email protected]> |
On Dec 7, 2011, at 0:14 , 烂馍馍. wrote:
> Hi, i think it will work correct.when one thread use encode,the
> others wait for.
> in java, i think we can do like this:
> synchronized (Encode) {
> Encode.encode(short[] in, byte[] out);
> }
The encoder and decoder use a state structure to maintain all state as
far as I know. As long as you're using different state as the first
argument to the various speex encode and decode functions for each
thread, you're fine. Why do you think otherwise?
> In the doc of speex: it says the speex is not thread-safe.
To quote from the documentation,
> One important thing to know is that libspeex calls are reentrant,
> but not thread-safe. That means that it is fine to use calls from
> many threads, but calls using the same state from multiple threads
> must be protected by mutexes.
It's pretty clear that this is safe as long as you use a different
state.
--
Steve Checkoway
_______________________________________________
Speex-dev mailing list
[email protected]
http://lists.xiph.org/mailman/listinfo/speex-dev
smime.p7s
(application/pkcs7-signature, 4.6 KB) - not displayed