ランキングに戻る

crossbeam-rs/crossbeam

Rust

Tools for concurrent programming in Rust

synchronizationconcurrencyparallelismthreadslock-freedata-structuresrust
スター成長
スター
8.5k
フォーク
563
週間成長
Issue
109
5k
2023年1月2024年3月2025年5月2026年7月
成果物crates.iocargo add crossbeam
README

Crossbeam

Build Status License Cargo Documentation Rust 1.74+ chat

This crate provides a set of tools for concurrent programming:

Atomics

  • AtomicCell, a thread-safe mutable memory location.(no_std)
  • AtomicConsume, for reading from primitive atomic types with "consume" ordering.(no_std)

Data structures

  • deque, work-stealing deques for building task schedulers.
  • ArrayQueue, a bounded MPMC queue that allocates a fixed-capacity buffer on construction.(alloc)
  • SegQueue, an unbounded MPMC queue that allocates small buffers, segments, on demand.(alloc)

Memory management

  • epoch, an epoch-based garbage collector.(alloc)

Thread synchronization

  • channel, multi-producer multi-consumer channels for message passing.
  • Parker, a thread parking primitive.
  • ShardedLock, a sharded reader-writer lock with fast concurrent reads.
  • WaitGroup, for synchronizing the beginning or end of some computation.

Utilities

  • Backoff, for exponential backoff in spin loops.(no_std)
  • CachePadded, for padding and aligning a value to the length of a cache line.(no_std)
  • scope, for spawning threads that borrow local variables from the stack.

Features marked with (no_std) can be used in no_std environments.
Features marked with (alloc) can be used in no_std environments, but only if alloc feature is enabled.

Crates

The main crossbeam crate just re-exports tools 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-queue provides concurrent queues that can be shared among threads.
  • crossbeam-utils provides atomics, synchronization primitives, scoped threads, and other utilities.

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

Usage

Add this to your Cargo.toml:

[dependencies]
crossbeam = "0.8"

Compatibility

Crossbeam supports stable Rust releases going back at least one year, and every time the minimum supported Rust version is increased, a new minor version is released. Currently, the minimum supported Rust version is 1.74.

Contributing

Crossbeam welcomes contribution from everyone in the form of suggestions, bug reports, pull requests, and feedback. 💛

If you need ideas for contribution, there are several ways to get started:

RFCs

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

You are welcome 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 relevant 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 keep in mind 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.

関連リポジトリ
syncthing/syncthing

Open Source Continuous File Synchronization

GoGo ModulesMozilla Public License 2.0synchronizationgo
syncthing.net
86.7k5.4k
smacke/ffsubsync

Automagically synchronize subtitles with video.

PythonPyPIMIT Licensesubtitlesvideo
7.8k319
syncthing/syncthing-android

Wrapper of syncthing for Android.

JavaMavenMozilla Public License 2.0androidjava
syncthing.net
4.3k514
syncthing/syncthing-macos

Official frugal and native macOS Syncthing application bundle

Objective-CMIT Licensesyncthingsynchronization
syncthing.net
3.8k198
Martchus/syncthingtray

Tray application and Dolphin/Plasma integration for Syncthing

C++Othertray-applicationsyncthing
martchus.github.io/syncthingtray/
2.9k67
luk4z7/go-concurrency-guide

Practical concurrency guide in Go, communication by channels, patterns

GoGo Modulesconcurrencyguideline
2.9k202
FISCO-BCOS/FISCO-BCOS

FISCO BCOS(发音为/ˈfɪskl bi:ˈkɒz/)是一个稳定、高效、安全的许可区块链平台,已被广泛应用于现实的行业应用。截至目前,已拥有5000多家企事业单位,400多个产业数字化标杆应用,涵盖文化版权、司法服务、政府服务、物联网、金融、智慧社区、房地产建设、社区治理、乡村振兴等领域。FISCO BCOS (pronounced /ˈfɪskl bi:ˈkɒz/) is a stable, efficient, and secure permissioned blockchain platform that has been widely used in real-world industry applications.

C++Apache License 2.0blockchainp2p
fisco-bcos-doc.readthedocs.io
2.6k746
remotestorage/remotestorage.js

⬡ JavaScript client library for integrating remoteStorage in apps

JavaScriptnpmMIT Licenseremotestorageremotestorage-client
remotestorage.io/rs.js/docs/
2.4k144
mikeroyal/Steam-Deck-Guide

Steam Deck Guide. Learn all about the Tools, Accessories, Games, Emulators, and Gaming Tips that will make your Steam Deck an awesome Gaming Handheld or a Portable Computer Workstation.

Rustcrates.iosteamsteamdeck
2.2k58
phw198/OutlookGoogleCalendarSync

Sync your Outlook and Google calendars

C#Mozilla Public License 2.0outlookgoogle
outlookgooglecalendarsync.com
2.1k230
teamtype/teamtype

Peer-to-peer, editor-agnostic collaborative editing of local text files.

Rustcrates.ioGNU Affero General Public License v3.0collaborative-editinglocal-first
teamtype.github.io/teamtype/
1.9k50
meganz/MEGAsync

Easy automated syncing between your computers and your MEGA Cloud Drive

C++Othersynchronizationcloud
1.9k304