#lock-free #atomic #non-blocking #lockfree-object-pool

no-std objectpool

Yet another lock-free object pool, support no_std

1 unstable release

0.1.0 May 24, 2024
0.0.0 May 24, 2024

#331 in Concurrency

Download history 246/week @ 2024-05-19 17/week @ 2024-05-26 1/week @ 2024-06-02

264 downloads per month

MIT/Apache

29KB
508 lines

Object Pool

Yet another lock-free object pool, support no_std.

github LoC Build codecov

docs.rs crates.io crates.io license

English | 简体中文

Features

  • Lock free, backed by concurrent safe queue.
  • Builtin reference counter, no Arc wrapper required.
  • Simple APIs and support no_std environment.
  • Automatically put object back to pool.

Installation

  • std

    [dependencies]
    objectpool = "0.1"
    
  • no_std

    [dependencies]
    objectpool = { version = "0.1", default-features = false, features = ["alloc"] }
    

Tests

  • test:

    cargo test
    
  • miri:

    cargo miri test
    
  • loom:

    cargo test --tests --features loom
    

Benchmarks

For detailed reports, you can see the latest Benchmark GitHub Action, and download the Artifacts.

cargo bench

Why this crate?

I need an object pool that supports the no_std environment. Unfortunately, none of the object-pool, lockfree-object-pool and sharded-slab support no_std.

License

objectpool is under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE, LICENSE-MIT for details.

Copyright (c) 2024 Al Liu.

Dependencies

~0.1–24MB
~316K SLoC