3 ms·
May be it's time to implement hardware CoW for RAM? Or can OS do it efficiently?
by vbezhenar 5y ago
May be it's time to implement hardware CoW for RAM? Or can OS do it efficiently?
- throwaway81523 5y agoI don't understand what you're getting at, but you can implement CoW at the page level with MMU hardware. That's how Redis dumping works, for example (the process forks into two, with one dumping to disk and the other continuing to take updates, CoW'ing pages that get modified and sharing the rest). What would CoW even mean inside a single address space? The idea of persistent data structures (as used in functional programming and other places) is that you never visibly modify anything, but instead make new objects that share structure with the old objects, relying on the GC to clean up data that stops being reachable.
- hutzlibu 5y agoWhat is CoW?
- detaro 5y agocopy-on-write
- chmike 5y agoI don't see how CoW would work with threads. It doesn't make sense to me.
- foota 5y agoThat sounds an awful lot like the x86 cache coherency protocol.
- BenFrantzDale 5y agoI don’t know about that, but I am using stlab::copy_on_write in production and it’s amazing. It’s like a cross among a T, a unique_ptr<T>, and a shared_ptr<const T>. https://github.com/stlab/libraries/blob/main/stlab/copy_on_write.hpp https://github.com/stlab/libraries/blob/main/stlab/copy_on_w...