Hi! I don't understand why we need to wrap the core storage inside Arc<RwLock<>> (in MemStorage example). I do understand what Arc and RwLock do, locking and exclusive write access, etc, (so no need explanation), but why do we need an exclusive access? Doesn't each node have its own log storage? Or do nodes may access their log storage asynchronously from a several threads simultaneously?
#[derive(Clone, Default)]
pub struct MemStorage {
core: Arc<RwLock<MemStorageCore>>,
}
Hi! I don't understand why we need to wrap the core storage inside
Arc<RwLock<>>(in MemStorage example). I do understand whatArcandRwLockdo, locking and exclusive write access, etc, (so no need explanation), but why do we need an exclusive access? Doesn't each node have its own log storage? Or do nodes may access their log storage asynchronously from a several threads simultaneously?