Single-threaded architecture

Use Rc instead of Arc and replace the concurrent LRU with
single-threaded SIEVE.

Fixes #23
Fixes #29
This commit is contained in:
Pekka Enberg
2024-03-03 11:57:47 +02:00
parent 8f48416de0
commit ed9f3e6d1e
14 changed files with 103 additions and 113 deletions

View File

@@ -4,11 +4,11 @@ use std::{
cell::{Ref, RefCell, RefMut},
mem::ManuallyDrop,
pin::Pin,
sync::Arc,
rc::Rc,
};
pub trait File {
fn pread(&self, pos: usize, c: Arc<Completion>) -> Result<()>;
fn pread(&self, pos: usize, c: Rc<Completion>) -> Result<()>;
}
pub trait IO {
@@ -46,7 +46,7 @@ impl Completion {
pub type BufferData = Pin<Vec<u8>>;
pub type BufferDropFn = Arc<dyn Fn(BufferData)>;
pub type BufferDropFn = Rc<dyn Fn(BufferData)>;
pub struct Buffer {
data: ManuallyDrop<BufferData>,