Coder Social home page Coder Social logo

crossbeam's Introduction

Crossbeam

Build Status License Cargo Documentation Rust 1.26+

This crate provides a set of tools for concurrent programming:

  • Atomics

    • ArcCell<T> is a shared mutable Arc<T> pointer.
    • AtomicCell<T> is equivalent to Cell<T>, except it is also thread-safe.
    • AtomicConsume allows reading from primitive atomic types with "consume" ordering.
  • Data structures

    • deque module contains work-stealing deques for building task schedulers.
    • MsQueue<T> and SegQueue<T> are simple concurrent queues.
    • TreiberStack<T> is a lock-free stack.
  • Synchronization

    • channel module contains multi-producer multi-consumer channels for message passing.
    • ShardedLock<T> is like RwLock<T>, but sharded for faster concurrent reads.
    • WaitGroup enables threads to synchronize the beginning or end of some computation.
  • Memory management

    • epoch module contains epoch-based garbage collection.
  • Utilities

    • CachePadded<T> pads and aligns a value to the length of a cache line.
    • scope() can spawn threads that borrow local variables from the stack.

Crates

Some of the tools live in the main crossbeam crate, and some are re-exported from smaller subcrates:

  • crossbeam-channel provides multi-producer multi-consumer channels for message passing.
  • crossbeam-deque provides work-stealing deques, which are primarily intended for building task schedulers.
  • crossbeam-epoch provides epoch-based garbage collection for building concurrent data structures.
  • crossbeam-utils provides miscellaneous utilities for concurrent programming:

Take a look at src/lib.rs to see what goes where.

There is one more experimental subcrate that is not yet included in crossbeam:

Usage

Add this to your Cargo.toml:

[dependencies]
crossbeam = "0.5"

Next, add this to your crate:

extern crate crossbeam;

Compatibility

The minimum supported Rust version is 1.26.

Features available in no_std environments:

  • AtomicCell<T>
  • AtomicConsume
  • CachePadded<T>
  • epoch (nightly Rust only)

Contributing

Crossbeam welcomes contribution from everyone in the form of suggestions, bug reports, pull requests, and feedback. ๐Ÿ’›

If you're looking for things to do, there are several easy ways to get started:

  • Found a bug or have a feature request? Tell us!
  • Issues and PRs labeled with feedback wanted need feedback from users and contributors.
  • Issues labeled with good first issue are relatively easy starter issues.

RFCs

We also have the RFCs repository for more high-level discussion. It is a place where we brainstorm ideas and propose substantial changes to Crossbeam.

Feel free to participate in any open issues or pull requests!

Learning resources

If you'd like to learn more about concurrency and non-blocking data structures, there's a list of learning resources in our wiki, which includes related blog posts, papers, videos, and other similar projects.

Another good place to visit is merged RFCs. They contain elaborate descriptions and rationale for features we've introduced to Crossbeam, but note that some of the written information is now out of date.

Conduct

The Crossbeam project adheres to the Rust Code of Conduct. This describes the minimum behavior expected from all contributors.

License

Licensed under either of

at your option.

Some Crossbeam subcrates have additional licensing notices. Take a look at other readme files in this repository for more information.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.