Skip to content

Releases: orxfun/orx-concurrent-vec

2024edition

11 Apr 14:35
b243a41
Compare
Choose a tag to compare

Migration to edition2024.

CI action is added.

Upgrade PseudoDefault dependency

11 Feb 11:40
d94ad23
Compare
Choose a tag to compare
Merge pull request #43 from orxfun/Upgrade-PseudoDefault-dependency

Upgrade PseudoDefault dependency

Dual license

08 Feb 18:27
780229c
Compare
Choose a tag to compare
Merge pull request #41 from orxfun/dual-license

dual license

Use-of-Collection-constrained-PinnedVecs

29 Jan 19:59
942b991
Compare
Choose a tag to compare

Upgrade pinned vectors to v3.12.

Feature "serde"

23 Jan 16:24
40ba0f4
Compare
Choose a tag to compare
  • Serialize & Deserialize are implemented for ConcurrentVec. The concurrent vector is represented as a regular sequence.
  • These implementations are available only through opt-in feature "serde".
  • Example usage can be found in the corresponding test file.

Upgrade PinnedVec dependencies

14 Dec 18:35
be6ae34
Compare
Choose a tag to compare
  • PinnedVec dependencies are upgraded to the latest.
  • New clippy warnings are fixed.

Towards lock-free safe concurrent mutation

22 Sep 15:57
e8403b9
Compare
Choose a tag to compare

A major revision towards enabling safe concurrent grow & read & udpate methods.

Following are the notable changes.

ConcurrentElement

ConcurrentElement struct is defined. A concurrent element is sort of an element which does not directly provide &T or &mut T references.

  • Instead, it provides thread-safe methods such as map, cloned, copied to read the data.
  • And it provides thread-safe update, set and replace methods to mutate the data.

Changes in the ConcurrentVec

Defining concurrent element api lead the changes in the entire crate:

  • vec.get(i) or vec[i] now returns &ConcurrentElement. All thread safe access to the value is then provided by the concurrent element.
  • Similarly vec.iter() yields references to concurrent elements.
  • Since concurrent elements can both be read and mutated, methods such as get_mut or iter_mut are not necessary.

ConcurrentSlice

ConcurrentSlice is defined. This struct is analogous to a slice of a vec or slice.

  • Slices provide safe and limited access to a certain region of the data. This feature is useful and convenient when we want to split the data to different threads.
  • Slices have all read & update methods, and as expected, lack the grow methods.

Safety and Partially Unsafe Methods

Safety guarantees are re-evaluated. With the safe api of the concurrent vec, we must not have a race condition. At least, this is the claim and expectation reflecting the design decisions. Tests are in line with the claim so far.

Methods that provide direct &T, &mut T, *const T or *mut T accesses are kept; however, marked as unsafe.

  • Unsafe methods are now better defined.
  • These methods are still partially safe due to the following:
    • We cannot end up with a dangling pointer when using these methods.
    • We cannot access out-of-bounds memory.
    • We cannot access uninitialized or freed memory.
  • The only undefined behavior we can experience is due to race conditions:
    • The references returned by these methods leak out of the vector. Although they will remain valid, concurrent vector now has no means of preventing race conditions. Even when the user only reads through &T, we can still have race conditions since the concurrent vec itselfs allow thread-safe update methods.
  • Possible scenarios where the unsafe methods can be safely used are documented, demonstrated with examples and tested.

Crate is converted to no_std

08 Sep 08:04
cad9020
Compare
Choose a tag to compare
Merge pull request #26 from orxfun/crate-turned-into-no_std

crated turned into no_std

Clone, Index and IndexMut traits implemented

28 Aug 19:28
a7e82ee
Compare
Choose a tag to compare
  • Thread safe Clone method is implemented.
  • Index and IndexMut traits are implemented for usize indices.
    • Due to possibly fragmented nature of the underlying pinned vec, and since we cannot return a reference to a temporarily created collection, currently index over a range is not possible. This would be possible with IndexMove (see rust-lang/rfcs#997).
  • Debug trait implementation is made mode convenient, revealing the current len and capacity in addition to the elements.
  • Upgraded dependencies to pinned-vec (3.7) and pinned-concurrent-col (2.6) versions.
  • Tests are extended:
    • concurrent clone is tested.
    • in addition to concurrent push & read, safety of concurrent extend & read is also tested.
  • boxcar::Vec is added to the benchmarks.

32-bit support

22 Aug 08:21
430efe4
Compare
Choose a tag to compare