#on-disk #copy #thread-safe #type #reference #locks #vector

diskvec

A thread-safe, on-disk vector for Copy types

3 releases

Uses old Rust 2015

0.1.2 Nov 3, 2017
0.1.1 Oct 29, 2017
0.1.0 Oct 29, 2017

#10 in #on-disk

GPL-3.0 license

16KB
357 lines

DiskVec

A thread-safe, on-disk vector for Copy types.

Documentation

Limitations

  • A value read from the diskarray might have been corrupted by faulty writes. For this reason, it is recommended that T carries its own checksum capability.
  • Write locks are done with a finite amount of mutexes, that may be less than the amount of elements in the vector, so deadlocks are possible even if you try to obtain mutable references to two different index positions.
  • Since reads are lock-free, there is no guarantee that the value you're holding a reference to will not change behind your back.

Guarantees

  • Writes are done using locks, so no writes will trample each other.

lib.rs:

A thread-safe, on-disk vector for Copy types.

Dependencies

~1MB
~18K SLoC