Skip to content

Is it safe to open a bonsaidb file from multiple processes at the same time? #261

Answered by ecton
jplatte asked this question in Q&A
Discussion options

You must be logged in to vote

No, it is not safe to open a single bonsaidb file from multiple processes simultaneously. There is file locking in place that should prevent it from happening, but I've only personally tested it on Linux.

I don't have plans on allowing multiple processes to access the same database. There is a fair amount of state that is kept in memory and assumed to be consistent with disk, and by allowing multiple processes, I need to either switch all of that to memory mapped data (not very safe to implement) or detect when to recache that state, which would potentially reduce performance.

I'm much more interested in adding IPC socket support to the server (#165) so that a local-only server could be r…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@jplatte
Comment options

@ecton
Comment options

@ecton
Comment options

@jplatte
Comment options

Answer selected by ecton
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants