Liste des Groupes | Revenir à cl c++ |
Artificial locking around ALL static locals as implemented by someDouble-checked locking nearly costs nothing.
modern compilers is highly wasteful as in most code, the code
structure already ensures a single thread will be the first to
execute that initialization/construction, often one of the threads
in the compiler itself.
That locking by compilers seem to be the result of someone in the C++ ctte wanting to take over every OS feature that used to be out of
scope for system programming languages like C/C++ . It also makes it
unnecessarily harder to use the system compiler to implement the lower
level code that exists at a more fundamental / portable level than
silly textbook examples .
Les messages affichés proviennent d'usenet.