Jean-Marc Valin wrote:> Never been tested but it should be. I don't use static variables (except > read-only which is OK).Are they actually read-only or are they initialized once? In the latter case, you need to protect the initialization section... <p>Segher --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'speex-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
> Are they actually read-only or are they initialized once? In the latter > case, you need to protect the initialization section...No, they're written to every time you enter the lsp_quant_* routines below. The only reason why this isn't catastrophic is that even wrong values (two threads writing at the same time) will only produce slightly sub-optimal results. The fix I proposed was to make the variable local in each function, since the value is never used after the function returns. Jean-Marc -- Jean-Marc Valin, M.Sc.A., ing. jr. LABORIUS (http://www.gel.usherb.ca/laborius) Université de Sherbrooke, Québec, Canada -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 190 bytes Desc: Ceci est une partie de message numériquement signée Url : http://lists.xiph.org/pipermail/speex-dev/attachments/20031030/501156cf/signature-0001.pgp
Jean-Marc Valin wrote:> > Are they actually read-only or are they initialized once? In the latter > > case, you need to protect the initialization section... > > No, they're written to every time you enter the lsp_quant_* routines > below. The only reason why this isn't catastrophic is that even wrong > values (two threads writing at the same time) will only produce slightly > sub-optimal results. The fix I proposed was to make the variable local > in each function, since the value is never used after the function > returns.I'm not talking about your bug, but about the data you said was read-only. Sorry if I wasn't clear enough. <p>Segher --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'speex-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.