Skip to content

Commit

Permalink
Expand comment
Browse files Browse the repository at this point in the history
  • Loading branch information
illicitonion committed Dec 13, 2017
1 parent 08ad5c8 commit d74904a
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/rust/engine/fs/src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,17 @@ mod local {
impl ByteStore {
pub fn new<P: AsRef<Path>>(path: P, pool: Arc<ResettablePool>) -> Result<ByteStore, String> {
let env = Environment::new()
// Without this flag, read transactions don't give up their reader slots until the thread
// they originated from dies. With the flag, read transactions give up their reader slots
// when they drop, which is much more friendly.
// Without this flag, each time a read transaction is started, it eats into our transaction
// limit (default: 126) until that thread dies.
//
// This flag makes transactions are removed from that limit when they are dropped, rather
// than when their thread dies. This is important, because we perform reads from a thread
// pool, so our threads never die. Without this flag, all read requests will fail after the
// first 126.
//
// The only down-side is that you need to make sure that any individual OS thread must not
// try to perform multiple write transactions concurrently. Fortunately, this property
// holds for us.
.set_flags(NO_TLS)
// 2 DBs; one for file contents, one for directories.
.set_max_dbs(2)
Expand Down

0 comments on commit d74904a

Please sign in to comment.