<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>LPC Microcontrollersのトピック,Newlib-none C++ exceptions and thread safety</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Newlib-none-C-exceptions-and-thread-safety/m-p/1168998#M42588</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;We’ve been using Freertos for 1 year for our embedded projects and we really love it.&lt;BR /&gt;A bit of context : our main target is a Cortex M33 (LPC55S69) which has plenty of flash and RAM.&lt;/P&gt;&lt;P&gt;We’ve started to port our C code base to C++ and we wonder if we can enable the C++ exceptions safely with the Freertos multithreaded environnement?&lt;BR /&gt;&lt;BR /&gt;I asked &lt;A href="https://forums.freertos.org/t/freertos-and-c-exceptions/10911" target="_self"&gt;Freertos forums&lt;/A&gt;&amp;nbsp;guys about this and they told me it depends on the newlib implementation. So, by default, are newlib-none (not nano!) C++ exceptions thread-safe? I'm using &lt;A href="http://www.nadler.com/embedded/NXP_newlibAndFreeRTOS.html" target="_self"&gt;heap_useNewlib from the great Dave Nadler&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;After a few test, I have strange behaviors when several tasks runs in parallel, if I do &lt;EM&gt;&lt;STRONG&gt;t&lt;/STRONG&gt;&lt;STRONG&gt;hrow / try / catch&lt;/STRONG&gt;&lt;/EM&gt; in them...&lt;/P&gt;&lt;P&gt;What do I need to do exactly to be able to use them safely in a multi threaded environnement?&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;Victor&lt;/P&gt;</description>
    <pubDate>Fri, 16 Oct 2020 16:43:40 GMT</pubDate>
    <dc:creator>v_canoz</dc:creator>
    <dc:date>2020-10-16T16:43:40Z</dc:date>
    <item>
      <title>,Newlib-none C++ exceptions and thread safety</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Newlib-none-C-exceptions-and-thread-safety/m-p/1168998#M42588</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;We’ve been using Freertos for 1 year for our embedded projects and we really love it.&lt;BR /&gt;A bit of context : our main target is a Cortex M33 (LPC55S69) which has plenty of flash and RAM.&lt;/P&gt;&lt;P&gt;We’ve started to port our C code base to C++ and we wonder if we can enable the C++ exceptions safely with the Freertos multithreaded environnement?&lt;BR /&gt;&lt;BR /&gt;I asked &lt;A href="https://forums.freertos.org/t/freertos-and-c-exceptions/10911" target="_self"&gt;Freertos forums&lt;/A&gt;&amp;nbsp;guys about this and they told me it depends on the newlib implementation. So, by default, are newlib-none (not nano!) C++ exceptions thread-safe? I'm using &lt;A href="http://www.nadler.com/embedded/NXP_newlibAndFreeRTOS.html" target="_self"&gt;heap_useNewlib from the great Dave Nadler&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;After a few test, I have strange behaviors when several tasks runs in parallel, if I do &lt;EM&gt;&lt;STRONG&gt;t&lt;/STRONG&gt;&lt;STRONG&gt;hrow / try / catch&lt;/STRONG&gt;&lt;/EM&gt; in them...&lt;/P&gt;&lt;P&gt;What do I need to do exactly to be able to use them safely in a multi threaded environnement?&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;Victor&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2020 16:43:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Newlib-none-C-exceptions-and-thread-safety/m-p/1168998#M42588</guid>
      <dc:creator>v_canoz</dc:creator>
      <dc:date>2020-10-16T16:43:40Z</dc:date>
    </item>
    <item>
      <title>Re: ,Newlib-none C++ exceptions and thread safety</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Newlib-none-C-exceptions-and-thread-safety/m-p/1172586#M42687</link>
      <description>&lt;P&gt;Hello Victor,&lt;/P&gt;
&lt;P&gt;I confirmed with our experts that Newlib does feature thread safely by itself. You would need to work with FreeRTOS to allow the implementation to be thread safe.&lt;/P&gt;
&lt;P&gt;They actually pointed to the implementation from Dave Nadler as reference. We do not have a FreeRTOS example with thread safety implemented.&lt;/P&gt;
&lt;P&gt;My apologies for the inconvenience.&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Gustavo&lt;/P&gt;</description>
      <pubDate>Fri, 23 Oct 2020 18:19:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Newlib-none-C-exceptions-and-thread-safety/m-p/1172586#M42687</guid>
      <dc:creator>gusarambula</dc:creator>
      <dc:date>2020-10-23T18:19:10Z</dc:date>
    </item>
  </channel>
</rss>

