vendredi 24 février 2017

How efficient is thread-safe initialisation of local static variables?

In VC 2015, and recent versions of Clang and GCC (and according to the C++11 standard), initialisation of local static variables is thread-safe.

How efficient is the actual implementation of this in the above compilers? Do they use a mutex?

I'm thinking of writing a high performance logging library that uses a static object at each call site (like Ayxia Trace) - will that be slow?

Aucun commentaire:

Enregistrer un commentaire