"why isn't darwin's strtod thread safe?" Code Answer

1

strtod is not thread safe. it's never been stated in any specs that it was thread-safe. you should be using strtod_l, which takes a locale. in all likelehood there is a shared data structure that is being clobbered by it's use in the threaded code.

locale_t c_locale = newlocale (lc_all_mask, "c", 0);
r = strtod_l(nptr, endptr, c_locale);
freelocale (c_locale);
By Messaoud Zahi on February 24 2022

Answers related to “why isn't darwin's strtod thread safe?”

Only authorized users can answer the Search term. Please sign in first, or register a free account.