Crate lockfree[][src]

A crate providing lock-free data structures and a solution for the "ABA problem" related to pointers.

The incinerator is the API which tries to solve the "ABA problem" when related to pointer dropping. With incinerator, every thread has a local deletion queue. Dropping a shared consist of first removing the pointer from the shared context, then adding the pointer to the local queue. Then, a global counter is checked. If the counter is zero, then the whole queue is deleted, otherwise, the queue will only be deleted later.

This counter is counting how many times the incinerator was asked to "pause". A thread may pause the incinerator to load and use the shared pointer, and this is why it is important to remove the pointer from the shared context before deleting.

This crate is under development, and there are plans for some structures. We have:

  • [x] Stack
  • [x] Queue
  • [ ] Deque
  • [ ] Map
  • [ ] Set

Modules

darc

Provides a doubly atomic reference counter.

incinerator

Incinerator API. The purpouse of this module is to solve the "ABA problem" related to pointers while still being lock-free. Incinerator is a garbage deleter which does not necessarilly deletes all garbage at the moment it was added to the queue, i.e. it can be paused while still not-blocking any thread.

prelude

Provides convenient re-exports.

queue

A lock-free queue.

stack

A lock-free stack.