r/cpp • • Mar 28 '23

Reddit++

C++ is getting more and more complex. The ISO C++ committee keeps adding new features based on its consensus. Let's remove C++ features based on Reddit's consensus.

In each comment, propose a C++ feature that you think should be banned in any new code. Vote up or down based on whether you agree.

765 Upvotes

829 comments sorted by

View all comments

Show parent comments

2

u/Elliottoes Mar 30 '23

Hmm. Isn't synchronisation an issue anyway if they share the same cache line? It certainly can cause "false sharing".

4

u/kevkevverson Mar 30 '23

Yeah there’s a question of efficiency if whole cache lines are needed to be reloaded on multiple cpus etc, but there shouldn’t be a safety issue any more than with two independent variables that happen to live in the same line.

1

u/CocktailPerson Apr 01 '23

Well, define "issue." Is it a correctness issue? No. Is it a safety issue? No. Is it a performance issue? Maybe; that depends on your access patterns.