al8n / orderwal

A generic-purpose, ordered, zero-copy, Write-Ahead Log implementation for Rust.
Apache License 2.0
5 stars 0 forks source link

Make `map` and `map_with_path_builder` of sync version WALs returns a reader backed by `unsync::Arena` #8

Open al8n opened 6 days ago

al8n commented 6 days ago

Suppose a sync version of sync::OrderWal or sync::GenericOrderWal is constructed by map or map_with_path_builder. In that case, there is no reason to use rarena_allocator::sync::Arena as the backend, because map or map_with_path_builder means that the OrderWal or GenericOrderWal cannot be modified anymore so that no data race will happen anymore.

Instance constructed by map or map_with_path_builder is not the same as reader methods of sync::OrderWal or sync::GenericOrderWal. reader let users create a read-only view on an active log, which means the writer can still modify the active log, so a rarena_allocator::sync::Arena is necessary for thread-safe.

al8n commented 1 day ago

Blocked by https://github.com/al8n/rarena/issues/14