3 ms·
As I understand it, it achives lockfree reads by having two caches: One for modifying and one for reading, and atomically swaps them after modifications (and ap
by BagOfPistchios 8y ago
As I understand it, it achives lockfree reads by having two caches: One for modifying and one for reading, and atomically swaps them after modifications (and applies the changes to what was previously the read cache).
Am I missing something or doesn't this reduce the overall memory available for cache by a factor 2x?
- dpezely 8y agoHe explains this at roughly the 40 minute mark. [1] "There's 7 more lines of `unsafe` that avoids keeping both maps. You still keep two maps, but you de-duplicate the data between those two maps." https://www.youtube.com/watch?v=s19G6n0UjsM&t=40m1s https://www.youtube.com/watch?v=s19G6n0UjsM&t=40m1s