Answer by Peter Cordes for Does the memory fence involve the kernel
std::atomic doesn't involve the kernel1On almost all normal CPUs (the kind we program for in real life), memory barrier instructions are unprivileged and get used directly by the compiler. The same way...
View ArticleAnswer by Sigi for Does the memory fence involve the kernel
In both this question and the referenced one you are mixing:synchronization primitives, in the assembler scope, like cmpxchg and fencesprocess/thread synchronizations, like futexesWhat does it means...
View ArticleDoes the memory fence involve the kernel
After asking this question, I've understood that the atomic instruction, such as test-and-set, would not involve the kernel. Only if a process needs to be put to sleep (to wait to acquire the lock) or...
View Article
More Pages to Explore .....