mtchavez / cuckoo Goto Github PK
View Code? Open in Web Editor NEWCuckoo Filter in golang for set membership approximation
License: Other
Cuckoo Filter in golang for set membership approximation
License: Other
I have something similar to this:
package main
import (
"github.com/mtchavez/cuckoo"
"sync"
)
type struct Persister {
filter cuckoo.Filter
fileName string
lock sync.Mutex
}
func (p *Persister) Save() {
p.lock.Lock()
defer p.lock.Unlock()
p.filter.Save(p.fileName)
}
I have multiple goroutines attempting to call Persister.Save()
after modifications to ensure that changes get persisted.
Since when Filter.Save()
returns, there seems to be no guarantee that the data is written to disk, it appears that these goroutines truncate file writes for each other and everything descends into madness with the size of my Filter
growing in memory within the program, but flapping in terms of disk file size: I see sizes of 29, 2MiB, 4MiB, and other values between, as these writes appear to be overlapping each other.
I'm not sure what the solution would be at the API level, but providing some way to guarantee consistency would be really helpful. For now, I have refactored my code to offset writes by consistent time periods using time.Ticker
.
Dependabot Preview will be shut down on August 3rd, 2021.
It appears that this repository has configured updates for dep
.
The GitHub-native version of Dependabot does not support dep
, which was deprecated as of 2020.
Guidance from the dep
maintainers is to upgrade to go mod, which Dependabot supports.
In order to keep getting updates for your Go dependencies, you'll need to migrate to go mod
and add a Dependabot configuration for it to this repository.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.