|
|
|
|
|
by ww520
838 days ago
|
|
Lock free has two advantages: the checking code can run in user mode and non-contested access is very cheap with just one instruction. To do it correctly, lock needs to be done in the kernel thus obtaining a lock requires calling into the kernel which is more expensive. I think you meant the memory barrier for syncing cache is just as expensive as the lock version, which is true. |
|