News for hackers. Stuff that matters.
Re:Ristretto: A High Performance, Concurrent, Memory-Bound G... by jeffomatic on Sunday September 22, 2019 @12:26AM (#21039665)
Question about the buffered writes and invalidation: is there anything that prevents race conditions between a Del() and a prior Set() on the same key? Just glancing at the source, it looks Set() ends up in a channel send, whereas Del() seems to synchronously update the internal map.
Re:Ristretto: A High Performance, Concurrent, Memory-Bound G... by NovaX on Sunday September 22, 2019 @12:43AM (#21039712)
I am not familiar with the Go code, but in the Java version (Caffeine) this is handled by a per-entry state machine. The entry is written to the Map first and the policy work buffered for replaying. If the replay occurs out-of-order (e.g. context switch before appending causing removal=>add), then the entry's state guards against policy corruption. This may not be necessary in their case due to using a sampling policy and other differences.
Re:Ristretto: A High Performance, Concurrent, Memory-Bound G... by mrjn on Sunday September 22, 2019 @07:06AM (#21040734)
Feel free to file an issue. That could cause correctness issue in Ristretto as of today.
Re:Ristretto: A High Performance, Concurrent, Memory-Bound G... by mrjn on Wednesday September 25, 2019 @12:27PM (#21072309)
This issue would fixed with this PR: https://github.com/dgraph-io/ristretto/pull/62