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 woken (because it couldn't acquire the lock but now can), then the kernel has to be involved to perform the scheduling operations.
If so, does it mean that the memory fence, such as std::atomic_thread_fence in c++11, won't also involve the kernel?
Aucun commentaire:
Enregistrer un commentaire