9 years, 6 months ago.

Is vsnprintf re-entrant or thread safe?

Is the mbed library function vsnprintf re-entrant or thread safe?

I want to call functions that use vsnprintf from both the main code and a Ticker.

I've looked in the Keil compiler documentation, but cannot find an answer.

1 Answer

9 years, 5 months ago.

Hi,

this link should answer your question http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.kui0099a/armlib_chdfgjej.htm

When using these functions, the string-based functions read the locale settings. Typically, they are thread-safe. However, if you change locale in mid-session, you must ensure that these functions are not affected.
The string-based functions, such as sprintf() and sscanf(), do not depend on the stdio library.

Regards,
0xc0170

Accepted Answer