If synchronization is turned off, in some cases C ++ threads will be faster.
By default, all standard C ++ streams are synchronized with their respective C streams.
Example:
#include <iostream> #include <cstdio> using namespace std; int main() { cout.sync_with_stdio(false); cout << "Hello\n"; printf("World\n"); cout << "...\n"; }
Output:
Hello ... World
Changing true gives the default result. Output:
Hello World ...
source share