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);
}
In the doc of speex: it says the speex is not thread-safe.
------------------ ???? ------------------
???: "????? ?????????"<romius99 at mail.ru>;
????: 2011?12?7?(???) ??4:00
???: "???."<xialonghua at vip.qq.com>;
??: "Jean-Marc Valin"<jmvalin at jmvalin.ca>;
"speex-dev"<speex-dev at xiph.org>;
??: Re: [Speex-dev] ??? ??? (no subject)
I'll try to explain. I want to create dll with only one function
"Encode" that will encode file to speex format. In my application I
will use this function from 16 threads, if it will work correct?
2011/12/6 ???. <xialonghua at vip.qq.com>
two thread send frames to only encoder at same time,two thread will use one
buffer
.it will work wrong if not Handling thread synchronization.
if not use same state, it need more memory, but no need to consider thread
safe.
------------------ ???? ------------------
???: "Jean-Marc Valin"<jmvalin at jmvalin.ca>;
????: 2011?12?6?(???) ??3:24
???: ""???.""<xialonghua at vip.qq.com>;
??: "speex-dev"<speex-dev at xiph.org>;
??: Re: ??? [Speex-dev] (no subject)
Well, please explain what you would expect from a "thread safe" codec
when you encode two frames at a time from the same encoder.
Jean-Marc
On 11-12-05 11:56 PM, ???. wrote:> yes? you are right.but its not one instance of codec.
>
>
> ------------------ ???? ------------------
> *???:* "Jean-Marc Valin"<jmvalin at
jmvalin.ca>;> *????:* 2011?12?6?(???) ??12:52
> *???:* "speex-dev"<speex-dev at
xiph.org>;> *??:* Re: [Speex-dev] (no subject)
>
> Actually, it *is* thread safe as long as you don't use the *same* state
> at the same time from two calls. i.e. you can easily encode
two> different streams from two different threads.
>
> Jean-Marc
>
> On 11-12-01 04:55 AM, ???. wrote:
>> it.s not safe.
>> >>
>> ------------------ Original ------------------
>> *From: * "????? ?????????"<romius99 at mail.ru>;
>> *Date: * Thu, Dec 1, 2011 04:43 PM
>> *To: * "speex-dev"<speex-dev at
xiph.org>;>> *Subject: * [Speex-dev] (no subject)
>>
>> Hi.
>> Is the speexlib thread safe?
>>>> _______________________________________________
>> Speex-dev mailing list
>> Speex-dev at xiph.org
>> http://lists.xiph.org/mailman/listinfo/speex-dev
>>>>
>>
>> _______________________________________________
>> Speex-dev mailing list
>> Speex-dev at xiph.org
>> http://lists.xiph.org/mailman/listinfo/speex-dev
> _______________________________________________> Speex-dev mailing list
> Speex-dev at xiph.org
> http://lists.xiph.org/mailman/listinfo/speex-dev
_______________________________________________
Speex-dev mailing list
Speex-dev at xiph.org
http://lists.xiph.org/mailman/listinfo/speex-dev
--
Regards
denis.romashenko at retell.co.uk
DDI (UK) +44(0)1932 773846
DDI (Il) +972(0)722451373
Mobile (Il) +972(0)545549366
Switchboard (UK) +44(0)1932 779755
Fax (UK) +44(0)1932 780383
Visit us at www.retellrecorders.co.uk
Retell Ltd, 53 Thames Street, Sunbury on Thames, Middlesex, TW16 5QH England.
Company VAT No. GB819112250
Registered in England & Wales no. 4871004 Reg Office: Heathrow Business
Centre, 65 High Street, Egham, Surrey TW20 9EY
READ OUR TERMS AND CONDITIONS FOR OUR GOODS AND SERVICES available at
www.retellrecorders.co.uk/buy/terms.htm before purchase.
Please contact us if you do not wish to receive information about Retell's
extensive range of call recording equipment.
THIS TRANSMISSION IS INTENDED ONLY FOR THE USE OF THE INDIVIDUAL OR ENTITY TO
WHICH IT IS ADDRESSED AND MAY CONTAIN INFORMATION THAT IS PRIVILEGED,
CONFIDENTIAL AND EXEMPT FROM DISCLOSURE UNDER APPLICABLE LAW. All correspondence
and agreement subject to contract. If you are not the intended recipient or
employee or agent responsible for delivering the transmission to the intended
recipient, please notify us by return. Any distribution or copying of this
document by anyone other than the intended recipient is strictly prohibited.
Retell cannot be held responsible for any alterations made to this document,
intentionally or otherwise after transmission. We check all our mail and
attachments for viruses using an up to date virus checker, but we cannot
guarantee that they are virus free.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.xiph.org/pipermail/speex-dev/attachments/20111207/7286d910/attachment-0001.htm