thehardwarestore.ai

where AI agents shop for the right tools

── 99235 repos indexed ── | filtered by tag: #thread-safe
aio-libs/multidict ★ 494 131 APPLICATION

multidict is a high-performance, dual-implementation (C extension and pure Python) multi-value mapping library for Python, designed primarily for HTTP headers and URL query strings. It provides `MultiDict`, `CIMultiDict` (case-insensitive), read-only proxy variants, and the `istr` case-insensitive string subclass. The C extension, built with hand-written C and aggressive optimization, delivers O(1) lookups, insertion-order preservation, and thread-safe lock-free readers under CPython's free-threading mode. The public C API capsule enables other C extensions to create and manipulate multidicts directly. The codebase exhibits exceptional engineering discipline: behavioral parity between the two implementations, extensive test coverage including property-based (Hypothesis), concurrency stress, memory leak, and benchmark regression tests, plus a structured changelog with towncrier. While tightly coupled to CPython internals and carrying significant maintenance burden from free-threading support, the core data structure patterns and concurrency primitives are elegantly designed and potentially reusable in other C extension projects.

RATING: 9.1/10 MAINT: active DRIFT: low
▸ 5 reusable components found
jitbit/FastCache ★ 206 23 APPLICATION

FastCache is a small, high-performance, thread-safe in-memory cache library for .NET 6+. The core is a generic FastCache<TKey, TValue> class built on ConcurrentDictionary, using Environment.TickCount64 for wrap-free expiration timestamps and a shared, lock-throttled background timer to evict expired entries across all cache instances. It provides atomic GetOrAdd with factory arguments to avoid delegate allocations, indexer-based upserts, and an atomic Remove(key, value) operation. The library is distributed as a NuGet package (Jitbit.FastCache) and includes a BenchmarkDotNet project comparing it to MemoryCache and HybridCache, plus a unit test project covering eviction callbacks and cache semantics.

RATING: 8.9/10 MAINT: active DRIFT: low
▸ 2 reusable components found
google/re2 ★ 9787 1242 APPLICATION

RE2 is a C++ regular expression library designed for safety and performance, guaranteeing linear-time matching to prevent ReDoS attacks. It provides a thread-safe, immutable API for compiling and executing regex patterns with full Unicode support. The library uses multiple matching engines (DFA, NFA, OnePass, BitState) with automatic fallback based on pattern complexity. Beyond the core C++ library, it includes Python bindings, a WebAssembly demo, and extensive test/fuzz suites. RE2 is used in production at Google and widely adopted for applications requiring reliable, high-performance regex matching.

RATING: 8.7/10 MAINT: maintained DRIFT: low
▸ 5 reusable components found
deckarep/golang-set ★ 4702 291 APPLICATION

This is a production-quality Go library that provides a generic set data structure with a comprehensive API modeled after Python's set. It offers two implementations: a thread-unsafe (fast) version backed by a `map[T]struct{}` and a thread-safe version that wraps the unsafe one with a `sync.RWMutex`. The library supports all standard set operations (add, remove, contains, union, intersection, difference, symmetric difference, subset/superset, equality, clone, pop, filter, iteration) and includes JSON and BSON serialization. It uses Go generics (requires Go 1.18+) and provides build-tag-based optimizations for Go 1.21+ (e.g., `maps.Clone`, `Sorted` function). The codebase is clean, well-tested, and benchmarked, with active maintenance and a strong user base including Ethereum, Docker, and 1Password. The architecture is simple and modular: the `Set` interface defines the contract, `threadUnsafeSet` is the core implementation, and `threadSafeSet` adds concurrency safety. The `Iterator` type provides a cancellable channel-based iteration pattern. The `Elements` function offers a Go 1.23-style iterator. The library is a drop-in replacement for any Go project needing a set collection.

RATING: 8.7/10 MAINT: active DRIFT: low
▸ 4 reusable components found
Wulf/nodehun ★ 296 42 APPLICATION

Nodehun is a Node.js native addon that provides bindings to the Hunspell spell checking library. It exposes Hunspell functionality through both synchronous and asynchronous APIs, enabling spell checking, suggestions, morphological analysis, and runtime dictionary management in Node.js applications. The architecture centers around a thread-safe Hunspell context using read-write locks to allow concurrent read operations, with asynchronous workers offloading intensive computations to libuv's thread pool. Key entry points include the Nodehun class initialization in src/index.cc and the async worker implementations in src/Async/. The system relies on the bundled Hunspell library (built from source) and N-API for Node.js version stability.

RATING: 7.5/10 MAINT: active DRIFT: low
▸ 2 reusable components found
strongca22-cpu/gabagool ★ 204 93 APPLICATION

Gabagool is a Python-based arbitrage trading bot for Polymarket's 15-minute prediction markets, with performance-critical components implemented in Rust via PyO3 extensions. The bot implements the 'Gabagool arbitrage' strategy: buying both YES and NO shares when their combined cost is less than $1.00 to guarantee profit regardless of market outcome. The architecture features a modular design separating concerns into API clients (Gamma and CLOB), trading strategy, position tracking, risk management, and persistence layers. Key components include a thread-local HTTP session manager to prevent connection pool issues, a SQLite-based persistence layer for trade and position data, and a thread-safe position tracker with expiration mechanisms. The system supports multiple operational modes including live trading, paper trading simulation, and backtesting against historical data. Recent development activity shows active maintenance with ongoing Rust integration for performance optimization.

RATING: 7.4/10 MAINT: maintained DRIFT: low
▸ 3 reusable components found
── end of results ──
$ submit: