jeudi 25 juillet 2019

It is possible to turn off thread safety in C++

I'm building an IO intensive distributed system, and I plan to make the process stateless in order to provide a single threaded, but scalable, runtime. I started the project in C, with libuv, and it worked great, with awesome performances. However, the development is taking much time, as C requires a lot of boilerplate code.

Therefore, I'm evaluating C++ as an alternative, however, I haven't found any way to opt out of thread safe structure such as std::shared_ptr. Is there any way, in clang or gcc, to disable atomic access to the standard library structure, as to have a single threaded process without any mutex/atomic overhead?

Aucun commentaire:

Enregistrer un commentaire