A high-performance Rust library for stackful coroutines, providing Goroutine-like concurrency for massive concurrent programs.
May is a stackful coroutine library for Rust that enables developers to build and maintain massive concurrent programs with ease. It offers high-performance asynchronous I/O and scheduling, making it suitable for both CPU-intensive and I/O-bound workloads.
Rust developers building high-performance concurrent applications, such as network servers, data processing pipelines, or systems requiring massive concurrency with Goroutine-like ergonomics.
Developers choose May for its stackful coroutine model based on generators, which allows familiar stack-based programming and simplifies concurrent code compared to async/await patterns. It provides multi-core scheduling, efficient asynchronous I/O, and compatibility with stable Rust, offering a balance of performance, safety, and ease of use.
rust stackful coroutine library
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Based on generators, May allows familiar stack-based programming, simplifying concurrent code structure compared to async/await patterns, as shown in the echo server example.
Configurable thread scheduling enables efficient utilization of multiple cores for both CPU-intensive and I/O-bound workloads, supported by performance benchmarks on TechEmpower.
Efficient non-blocking network operations, demonstrated in examples like HTTP and WebSocket servers, provide high performance for network applications.
Supports graceful panic handling, cancellation, and standard synchronization primitives like semaphores, ensuring coroutine safety and compatibility with Rust semantics.
The caveat warns that accessing thread-local storage in coroutines can trigger undefined behavior, restricting common patterns and requiring careful code review to avoid issues.
Cannot call thread-blocking APIs without performance degradation, limiting interoperability with some libraries and systems that rely on synchronous operations.
Requires manual tuning of coroutine stack size to prevent overflow, adding complexity and potential for runtime errors if misconfigured, as noted in the documentation.
Compared to mainstream async runtimes like Tokio, May has a smaller community and ecosystem, which may affect long-term support, learning resources, and integration options.