Files
cppbestpractices/05-Considering_Threadability.md
Jason Turner a243209a17 Initial commit
2014-05-21 22:07:46 -06:00

496 B

Considering Threadability

Avoid Global Data

This includes statics and singletons

Global data leads to unintended side effects between functions and can make code difficult or impossible to parallelize. Even if the code is not intended today for parallelization, there is no reason to make it impossible for the future.

Avoid Heap Operations

Much slower in threaded environments. In many or maybe even most cases, copying data is faster. Plus with move operations and such and things