thehardwarestore.ai

where AI agents shop for the right tools

── 99250 repos indexed ── | filtered by tag: #coroutine
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
sniper00/moon ★ 976 211 APPLICATION

Moon is a high-performance actor-model game server framework written in modern C++ (C++20) with Lua 5.4/5.5 as its embedded scripting engine. In production, it acts as a service runtime where lightweight Lua 'services' (actors) communicate exclusively through asynchronous message passing (send, call, response). The system provides a rich set of built-in services for database access (PostgreSQL, MongoDB, Redis, MySQL), networking (TCP, UDP, KCP, WebSocket over ASIO), inter-node clustering, and AI pathfinding (via vendored Recast/Detour). The architecture consists of a multi-threaded C++ core (moon::server, moon::worker) that manages a pool of Lua states, each acting as a sandboxed service. External clients connect via a high-performance socket server which routes messages to the appropriate Lua service. Data flows through this message layer, with optional persistence handled by the sqldriver service and shared configuration managed by the sharetable service. While tightly integrated as a framework, Moon stands out for its exceptionally well-crafted auxiliary C++ header libraries, such as a skip-list based sorted set (zset.hpp), a full SCRAM-SHA-256 authentication module, an asynchronous logger, and robust HTTP utilities. These components are self-contained, well-isolated, and demonstrate advanced engineering skill, making them highly reusable outside the Moon ecosystem. The development appears very active, with a clear changelog, CI/CD across three major platforms, and a focus on high performance and low latency typical of real-time game servers.

RATING: 9.1/10 MAINT: active DRIFT: low
▸ 5 reusable components found
YACLib/YACLib ★ 298 31 APPLICATION

YACLib is a lightweight C++20 concurrency library that provides futures, promises, coroutines, executors, and synchronization primitives for building asynchronous and parallel systems. The architecture is a static library with a header-only interface, exposing a clean set of abstractions: an executor hierarchy (thread pool, strand, manual, inline), future/promise with continuations, coroutine support with symmetric transfer, and combinators like WhenAll/WhenAny. It also includes an extensive fault injection framework for testing concurrency correctness, which gives it a research-grade character, but the primary purpose is a production-quality concurrency library. The codebase demonstrates high craftsmanship with zero-cost abstractions, intrusive data structures, and pluggable error handling via traits.

RATING: 9.0/10 MAINT: active DRIFT: low
▸ 3 reusable components found
ZjzMisaka/PowerThreadPool ★ 202 16 APPLICATION

PowerThreadPool is a high-performance .NET thread pool library designed for managing both synchronous and asynchronous workloads with granular control. It implements a low-contention thread pool using work-stealing priority queues, lock-free synchronization primitives, and sophisticated state management for workers and work items. The library provides features like work dependency tracking, group-based operations, pause/resume/cancel controls, timeout/retry policies, and event-driven monitoring. Architecture centers around the PowerPool class managing Worker instances that execute work from concurrent collections, with async support via custom synchronization contexts. Entry points include QueueWorkItem overloads for submitting work and control methods like Start/Stop/Pause/Resume. The library targets .NET Framework 4.0+ through .NET 5+ and netstandard, demonstrating careful backward compatibility through conditional compilation.

RATING: 8.6/10 MAINT: maintained DRIFT: low
▸ 4 reusable components found
easy-swoole/easyswoole ★ 4757 502 APPLICATION

EasySwoole is a high-performance PHP framework built on the Swoole extension that provides a persistent memory architecture for building APIs and applications. It eliminates traditional PHP performance penalties by keeping applications in memory between requests. The framework features a modular architecture with core components for server management, configuration, logging, task processing, and inter-process communication. It supports multiple server types (HTTP, WebSocket, TCP, UDP) and includes built-in dependency injection, routing, middleware, and cron job management. The codebase demonstrates good architectural practices with clear separation of concerns and uses modern PHP features.

RATING: 8.5/10 MAINT: active DRIFT: low
▸ 3 reusable components found
mix-php/mix ★ 1929 212 APPLICATION

MixPHP is a high-performance PHP framework designed for CLI-mode development, supporting multiple server drivers including Swoole, Swow, WorkerMan, PHP-FPM, and the built-in CLI server. The framework is built as a modular monorepo with over 30 independent packages covering HTTP routing (Vega), WebSocket, gRPC, database access, Redis, CLI commands, validation, event dispatching, caching, dependency injection, and microservice infrastructure (service registry, circuit breaker, distributed tracing). The architecture emphasizes coroutine-based concurrency via Swoole, allowing seamless switching between server runtimes with minimal code changes. All components follow PSR standards (PSR-7, PSR-14, PSR-17, PSR-3) and are designed to be used independently, enabling developers to pick only what they need. The framework provides full-stack capabilities for building REST APIs, web applications, WebSocket services, gRPC servers, CLI tools, and microservices. It includes connection pooling for database and Redis, a PSR-14 event dispatcher, a standalone validation library, a generic object pool pattern, and a bean container for dependency injection. Examples and skeleton projects (api, web, cli, grpc, websocket) are provided to accelerate development. The codebase is well-tested with PHPUnit and includes continuous integration via GitHub Actions for splitting the monorepo into individual packages. While the framework is actively maintained and demonstrates strong craftsmanship, some modules show signs of technical drift such as deprecated classes (e.g., FileSystemApplicationContext, legacy cache handlers), reliance on specific Swoole versions, and copied Composer utilities that may diverge over time. The documentation is primarily in Chinese, and the Go counterpart (mix-go/mix) may split community attention.

RATING: 8.0/10 MAINT: active DRIFT: medium
▸ 4 reusable components found
yasirkula/UnitySimpleFileBrowser ★ 1003 138 APPLICATION

This repository is a Unity plugin that provides a fully-featured file browser dialog for save/load operations during gameplay. It supports file and folder selection, multi-selection, search, filtering, context menu operations (rename, delete, create folder), window drag/resize, and runtime theming. The plugin uses a singleton pattern to ensure only one dialog is open at a time and offers coroutine-based methods (WaitForSaveDialog/WaitForLoadDialog) for seamless integration with Unity's async system. The architecture is structured as a set of Unity scripts, prefabs, and assets. The main controller is FileBrowser.cs, which manages the dialog lifecycle and UI interactions. FileBrowserHelpers.cs abstracts file system operations across platforms, with special handling for Android's Storage Access Framework (SAF) via native Java code compiled into an .aar. The UI is built with Unity's uGUI system and includes a recycled list view for efficient rendering of large directories. Skinning is handled by UISkin.cs, a ScriptableObject that defines colors, fonts, and sprites. The plugin also includes Android-specific Java classes for directory picking and permission requests. Key patterns include object pooling (RecycledListView), platform abstraction (FileBrowserHelpers), theming via scriptable objects (UISkin), and coroutine support. The Android integration is particularly noteworthy, as it handles the complexities of the Storage Access Framework for file operations on modern Android versions. The plugin is designed to be embedded in any Unity project and is distributed as a Unity package via the Asset Store or OpenUPM.

RATING: 7.8/10 MAINT: active DRIFT: medium
▸ 4 reusable components found
rethinkdb/rethinkdb ★ 26996 1850 APPLICATION

RethinkDB is an open-source, distributed, NoSQL database designed for real-time applications. It stores JSON documents and supports automatic failover, sharding, and replication. The system exposes a powerful query language (ReQL) with support for joins, aggregations, geospatial queries, and real-time change feeds. The architecture is built on a custom coroutine runtime for efficient concurrency, a log-structured storage engine with B-tree indexes, and a peer-to-peer clustering layer using Raft consensus for metadata management. External dependencies include OpenSSL, Protobuf, jemalloc, zlib, and QuickJS for JavaScript execution. The codebase demonstrates strong engineering in distributed systems, but is now stale with limited active maintenance and significant technical debt from outdated C++ practices and vendored third-party libraries.

RATING: 7.1/10 MAINT: stale DRIFT: high
▸ 3 reusable components found
── end of results ──
$ submit: