,Newlib-none C++ exceptions and thread safety

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

,Newlib-none C++ exceptions and thread safety

1,019件の閲覧回数
v_canoz
Contributor III

Hello

We’ve been using Freertos for 1 year for our embedded projects and we really love it.
A bit of context : our main target is a Cortex M33 (LPC55S69) which has plenty of flash and RAM.

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?

I asked Freertos forums 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 heap_useNewlib from the great Dave Nadler.

After a few test, I have strange behaviors when several tasks runs in parallel, if I do throw / try / catch in them...

What do I need to do exactly to be able to use them safely in a multi threaded environnement?

Many thanks,

Victor

1 返信

982件の閲覧回数
gusarambula
NXP TechSupport
NXP TechSupport

Hello Victor,

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.

They actually pointed to the implementation from Dave Nadler as reference. We do not have a FreeRTOS example with thread safety implemented.

My apologies for the inconvenience.

Regards,
Gustavo

0 件の賞賛
返信