<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <font size="2"><font face="Helvetica, Arial, sans-serif">Hi,<br>
        <br>
        Using the call to:<br>
        _configthreadlocale(_ENABLE_PER_THREAD_LOCALE);<br>
        at the start of the Live555 engine thread fixed the issue
        detailed in this thread.<br>
        <br>
        Thanks,<br>
        Richard.<br>
      </font></font><br>
    <div class="moz-cite-prefix">On 27/10/2021 10:11, Richard Lince
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:ac7adc58-89b9-48e8-1188-df76ea55912f@bluebox.video">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <font size="-1"><font face="Helvetica, Arial, sans-serif">Hi </font></font><font
        size="-1"><font face="Helvetica, Arial, sans-serif"><font
            size="-1"><font face="Helvetica, Arial, sans-serif">Jonathon/Ross</font></font>,<br>
          <br>
          Thanks for the info Jonathon, humbly missed this, I suspect
          the heap corruption throw me whilst performing the tests.<br>
          For it's worth, using the libraries for client sink, setlocale
          is the only call which fails in a multi-threaded environment
          on a current Windows 10 platform.<br>
          <br>
          I've two options, modify the code to add a lock, which I do
          not want to do, or understand the consequences of defining 
          LOCALE_NOT_USED.<br>
          As a final note on this email chain, can you tell me what
          those considerations may be if setlocale is not called?<br>
          What issues may we run into as a client or server endpoint
          using the libraries not calling this function?<br>
           <br>
          Appreciated,<br>
          Richard.<br>
        </font></font><br>
      <div class="moz-cite-prefix">On 26/10/2021 21:07, Ross Finlayson
        wrote:<br>
      </div>
      <blockquote type="cite"
        cite="mid:697BE6CD-A94C-4046-9425-16D77647E3E0@live555.com">
        <blockquote type="cite">
          <pre class="moz-quote-pre" wrap="">On Oct 27, 2021, at 5:29 AM, Jonathan Brady via live-devel <a class="moz-txt-link-rfc2396E" href="mailto:live-devel@us.live555.com" moz-do-not-send="true"><live-devel@us.live555.com></a> wrote:

        • On Windows setlocale is not thread safe
                • <a class="moz-txt-link-freetext" href="https://social.msdn.microsoft.com/Forums/windowsserver/en-US/b46aa226-d337-43c3-8d15-135f6fca9b53/setlocale-behavior-in-multithreaded-applications?forum=vcgeneral" moz-do-not-send="true">https://social.msdn.microsoft.com/Forums/windowsserver/en-US/b46aa226-d337-43c3-8d15-135f6fca9b53/setlocale-behavior-in-multithreaded-applications?forum=vcgeneral</a>
        • It hasn't been thread safe since Visual C++ 2012.
                • <a class="moz-txt-link-freetext" href="https://www.tolon.co.uk/2014/10/beware-setlocale/" moz-do-not-send="true">https://www.tolon.co.uk/2014/10/beware-setlocale/</a>
</pre>
        </blockquote>
        <pre class="moz-quote-pre" wrap="">Thanks for the info.  Although we can try to make our code safe to run in multiple threads, there’s not a lot we can do if an underlying language runtime library or OS call is not thread safe.

Another reason to avoid threads, if possible.


Ross Finlayson
Live Networks, Inc.
<a class="moz-txt-link-freetext" href="http://www.live555.com/" moz-do-not-send="true">http://www.live555.com/</a>


_______________________________________________
live-devel mailing list
<a class="moz-txt-link-abbreviated moz-txt-link-freetext" href="mailto:live-devel@lists.live555.com" moz-do-not-send="true">live-devel@lists.live555.com</a>
<a class="moz-txt-link-freetext" href="http://lists.live555.com/mailman/listinfo/live-devel" moz-do-not-send="true">http://lists.live555.com/mailman/listinfo/live-devel</a>
</pre>
      </blockquote>
      <br>
      <div class="moz-signature"><font size="2" face="calibri"
          color="black"> Best Regards,<br>
          Richard Lince,<br>
          Founder & Managing Director<br>
          <br>
          <a href="https://www.bluebox.video" moz-do-not-send="true">bluebox.video</a>
          <br>
          +44(0)7841665146<br>
        </font><br>
        <img alt="logo" src="cid:part1.l0n3eAZP.Kzoip0vk@bluebox.video"
          class=""></div>
    </blockquote>
    <br>
    <div class="moz-signature"><font size="2" face="calibri"
        color="black">
        Best Regards,<br>
        Richard Lince,<br>
        Founder & Managing Director<br>
        <br>
        <a href="https://www.bluebox.video">bluebox.video</a> <br>
        +44(0)7841665146<br>
      </font><br>
      <img alt="logo" src="cid:part1.l0n3eAZP.Kzoip0vk@bluebox.video"></div>
  </body>
</html>