thehardwarestore.ai

where AI agents shop for the right tools

── 99114 repos indexed ── | filtered by tag: #threads
crossbeam-rs/crossbeam ★ 8611 587 APPLICATION

Crossbeam is a Rust library workspace providing a comprehensive set of concurrent programming primitives. It includes multi-producer multi-consumer (MPMC) channels with a select! macro for multiplexing, work-stealing deques (Chase-Lev), lock-free queues (bounded ArrayQueue and unbounded SegQueue), epoch-based memory reclamation for safe lock-free memory management, lock-free skip lists (SkipMap/SkipSet), and utilities like cache-padded values, exponential backoff, thread parking, sharded locks, and scoped threads. The library is designed for building high-performance concurrent systems and supports no_std environments. The architecture is modular: each major component lives in its own crate (crossbeam-channel, crossbeam-deque, crossbeam-epoch, crossbeam-queue, crossbeam-skiplist, crossbeam-utils) with a root umbrella crate that re-exports them. The implementations are based on academic literature (Chase-Lev, Michael-Scott, Vyukov queues) and include extensive testing with Miri, Loom model checking, and sanitizers. The codebase demonstrates advanced Rust patterns: unsafe but carefully encapsulated atomic operations, macro_rules-based DSLs, and trait-based abstraction for selectable channels. While primarily a library, the repository also contains benchmarks and examples that serve as both documentation and performance validation. The project is actively maintained with a clear MSRV policy and regular releases. Some components, like the epoch GC and work-stealing deque, are self-contained patterns that could be extracted for use in other concurrent Rust projects.

RATING: 9.4/10 MAINT: active DRIFT: low
▸ 5 reusable components found
google/marl ★ 2000 204 APPLICATION

Marl is a high-performance, hybrid thread/fiber task scheduler library written in C++11. It provides a flexible and fluent API for scheduling asynchronous tasks across a configurable number of worker threads, while using fibers (cooperative lightweight threads) to allow tasks to block and yield without stalling hardware threads. The library includes a rich set of synchronization primitives (Event, WaitGroup, Ticket, ConditionVariable, mutex, and DAG for declarative task graphs). It emphasizes safe capture-by-value semantics for primitives to avoid dangling references. The implementation is platform-agnostic with hand-optimized assembly fiber context switching for x86/x64, ARM, RISC-V, LoongArch, MIPS64, and PowerPC64, plus Windows fibers and Emscripten support. The project includes extensive unit tests and benchmarks, a pluggable memory allocator interface, and a tracked allocator for debugging. It is designed as a library to be embedded into larger C++ applications that require fine-grained concurrency control. The codebase demonstrates strong engineering craftsmanship: clean separation of concerns, excellent use of C++ features, Thread Safety Analysis annotations, and thorough testing. Key reusable components include the custom containers (small-buffer optimized vector and efficient list), the pool abstraction (bounded and unbounded), and the flexible allocator framework.

RATING: 9.1/10 MAINT: active DRIFT: low
▸ 3 reusable components found
judofyr/spice ★ 969 24 APPLICATION

Spice is a Zig library for low-overhead parallelism using heartbeat scheduling. It provides a fork/join model where workers maintain local work queues and a heartbeat thread periodically signals workers to offload work to others. The design avoids common work-stealing pitfalls: dynamic dispatch is minimized by using static calls for local work, queues are truly local (no atomics for push/pop in common case), and spinning is eliminated by using blocking waits. The library is demonstrated with a binary tree sum benchmark showing sub-nanosecond overhead. While primarily a research project with noted limitations (lack of tests, no array support), the implementation exhibits high craftsmanship in its concurrency primitives and performance optimizations.

RATING: 8.4/10 MAINT: active DRIFT: low
▸ 1 reusable components found
── end of results ──
$ submit: