phantomhker

Results 5 comments of phantomhker

The ExpirationMap is RwLock, when trying to borrow mutable reference failed, the CacheProcessor will return, and finally the channel closed. Maybe you can remove the RefCell, just use RwLock's write...

it does not work properly, that's my testing code ``` fn print_map_random(m: &HashMap,times: usize) { for _ in 0..times { for (k, v) in m.iter_at(0) { println!("{k}-{v}"); } println!("=========") }...

> between calls to `k := range map`. Thank u very much for your discovery, I'm recently migrating a golang project whose cache library is ristretto to rust with stretto....

> It seems that the ring buffer is related to frequency in admit policy, why do you think it's useless? > > > between calls to `k := range map`....

> The defaultPolicy in ristretto actually implements the ringConsumer interface, the Push() method will be called in getBuf, maybe you can see here https://github.com/dgraph-io/ristretto/blob/main/policy.go#L113. And that's why the push() method...