<div>Hi, i think it will work correct.when one thread use encode,the others wait for.</div><div><div>in java, i think we can do like this:</div><div>synchronized (Encode) {</div><div> Encode.encode(short[] in, byte[] out);</div><div>}</div></div><div><includetail><div>In the doc of speex: it says the speex is not thread-safe.</div><div> </div><div style="font:Verdana normal 14px;color:#000;"><div style="FONT-SIZE: 12px;FONT-FAMILY: Arial Narrow;padding:2px 0 2px 0;">------------------ 原始邮件 ------------------</div><div style="FONT-SIZE: 12px;background:#efefef;padding:8px;"><div id="menu_sender"><b>发件人:</b> "Денис Ромашенко"<romius99@mail.ru>;</div><div><b>发送时间:</b> 2011年12月7日(星期三) 下午4:00</div><div><b>收件人:</b> "烂馍馍."<xialonghua@vip.qq.com>; <wbr></div><div><b>抄送:</b> "Jean-Marc Valin"<jmvalin@jmvalin.ca>; "speex-dev"<speex-dev@xiph.org>; <wbr></div><div><b>主题:</b> Re: [Speex-dev] 回复: 回复: (no subject)</div></div><div> </div><div dir="ltr">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?<br>
<br><div class="gmail_quote">2011/12/6 烂馍馍. <span dir="ltr"><<a href="mailto:xialonghua@vip.qq.com">xialonghua@vip.qq.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><br></div><div><u></u><div> two thread send frames to only encoder at same time,two thread will use one buffer</div><div>.it will work wrong if not <font face="arial, sans-serif" size="2" color="#333333"><span style="line-height:normal">Handling thread synchronization.</span></font></div>
<div>if not use same state, it need more memory, but no need to consider thread safe.</div><div> </div><div style="font:Verdana normal 14px;color:#000"><div style="FONT-SIZE:12px;FONT-FAMILY:Arial Narrow;padding:2px 0 2px 0">
------------------ 原始邮件 ------------------</div><div style="FONT-SIZE:12px;background:#efefef;padding:8px"><div><b>发件人:</b> "Jean-Marc Valin"<<a href="mailto:jmvalin@jmvalin.ca" target="_blank">jmvalin@jmvalin.ca</a>>;</div>
<div><b>发送时间:</b> <a value="+9722011" target="_blank">2011</a>年12月6日(星期二) 下午3:24</div><div><b>收件人:</b> ""烂馍馍.""<<a href="mailto:xialonghua@vip.qq.com" target="_blank">xialonghua@vip.qq.com</a>>; <u></u></div>
<div><b>抄送:</b> "speex-dev"<<a href="mailto:speex-dev@xiph.org" target="_blank">speex-dev@xiph.org</a>>; <u></u></div><div><b>主题:</b> Re: 回复: [Speex-dev] (no subject)</div></div><div> </div>Well, please explain what you would expect from a "thread safe" codec<br>
when you encode two frames at a time from the same encoder.<br><br>        Jean-Marc<br><br>On 11-12-05 11:56 PM, 烂馍馍. wrote:<br>> yes, you are right.but its not one instance of codec.<br>> <br>> <br>> ------------------ 原始邮件 ------------------<br>
> *发件人:* "Jean-Marc Valin"<<a href="mailto:jmvalin@jmvalin.ca" target="_blank">jmvalin@jmvalin.ca</a>>;<br>> *发送时间:* <a value="+9722011" target="_blank">2011</a>年12月6日(星期二) 中午12:52<br>
> *收件人:* "speex-dev"<<a href="mailto:speex-dev@xiph.org" target="_blank">speex-dev@xiph.org</a>>;<br>> *主题:* Re: [Speex-dev] (no subject)<br>> <br>> Actually, it *is* thread safe as long as you don't use the *same* state<br>
> at the same time from two calls. i.e. you can easily encode two<br>> different streams from two different threads.<br>> <br>> Jean-Marc<br>> <br>> On 11-12-01 04:55 AM, 烂馍馍. wrote:<br>>> it.s not safe.<br>
>> <br>>> <br>>> ------------------ Original ------------------<br>>> *From: * "Денис Ромашенко"<<a href="mailto:romius99@mail.ru" target="_blank">romius99@mail.ru</a>>;<br>>> *Date: * Thu, Dec 1, <a value="+9722011" target="_blank">2011</a> 04:43 PM<br>
>> *To: * "speex-dev"<<a href="mailto:speex-dev@xiph.org" target="_blank">speex-dev@xiph.org</a>>;<br>>> *Subject: * [Speex-dev] (no subject)<br>>> <br>>> Hi.<br>>> Is the speexlib thread safe?<br>
>><br>>> _______________________________________________<br>>> Speex-dev mailing list<br>>> <a href="mailto:Speex-dev@xiph.org" target="_blank">Speex-dev@xiph.org</a><br>>> <a href="http://lists.xiph.org/mailman/listinfo/speex-dev" target="_blank">http://lists.xiph.org/mailman/listinfo/speex-dev</a><br>
>><br>>><br>>><br>>> _______________________________________________<br>>> Speex-dev mailing list<br>>> <a href="mailto:Speex-dev@xiph.org" target="_blank">Speex-dev@xiph.org</a><br>>> <a href="http://lists.xiph.org/mailman/listinfo/speex-dev" target="_blank">http://lists.xiph.org/mailman/listinfo/speex-dev</a><br>
> _______________________________________________<br>> Speex-dev mailing list<br>> <a href="mailto:Speex-dev@xiph.org" target="_blank">Speex-dev@xiph.org</a><br>> <a href="http://lists.xiph.org/mailman/listinfo/speex-dev" target="_blank">http://lists.xiph.org/mailman/listinfo/speex-dev</a><br>
<br></div><u></u></div><br>_______________________________________________<br>
Speex-dev mailing list<br>
<a href="mailto:Speex-dev@xiph.org">Speex-dev@xiph.org</a><br>
<a href="http://lists.xiph.org/mailman/listinfo/speex-dev" target="_blank">http://lists.xiph.org/mailman/listinfo/speex-dev</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Regards<br><br><a href="mailto:denis.romashenko@retell.co.uk">denis.romashenko@retell.co.uk</a><br>DDI (UK) +44(0)1932 773846<br>DDI (Il) +972(0)722451373<br>Mobile (Il) +972(0)545549366<br>
Switchboard (UK) +44(0)1932 779755<br>Fax (UK) +44(0)1932 780383<br>Visit us at <a href="http://www.retellrecorders.co.uk">www.retellrecorders.co.uk</a> <br>Retell Ltd, 53 Thames Street, Sunbury on Thames, Middlesex, TW16 5QH England. Company VAT No. GB819112250<br>
<br>Registered in England & Wales no. 4871004 Reg Office: Heathrow Business Centre, 65 High Street, Egham, Surrey TW20 9EY <br>READ OUR TERMS AND CONDITIONS FOR OUR GOODS AND SERVICES available at <a href="http://www.retellrecorders.co.uk/buy/terms.htm">www.retellrecorders.co.uk/buy/terms.htm</a> before purchase.<br>
Please contact us if you do not wish to receive information about Retell's extensive range of call recording equipment.<br><br>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.<br>
<br>
</div>
</div></includetail></div>