← All stories
● Covered by 1 source Β· 1 reportMedium impact

Runloom Introduces Go-style Coroutines for Python with Free-Threading

Aggregated by BrevFeed dev Β· updated 23h ago
πŸ”– Save

Runloom has released a library for Python that implements Go-style stackful coroutines, enabling concurrent execution across multiple cores in Python environments without the Global Interpreter Lock. This new library allows for high-throughput and low-latency networking operations by utilizing hand-crafted assembly for context switching and a C work-stealing scheduler.

Key points

Overview of Runloom

Runloom provides stackful coroutines for Python, modeled after Go's concurrency model. It offers a method to write blocking code using functions like fiber(fn), enabling users to manage many simultaneous operations without async/await syntax. This is particularly useful for I/O-bound tasks, allowing Python to utilize multiple CPU cores effectively.

Technical Aspects

The library includes a custom assembly context switch, achieving around 80 ns per swap with no syscall overhead. It employs a work-stealing scheduler to optimize fiber execution, which allows overlapping I/O operations across cores without being blocked by other tasks. Runloom's architecture supports a high number of concurrent coroutines with efficient memory usage and scheduling.

Performance Comparisons

Benchmarks indicate that Runloom achieves spawn rates competitive with Go, reportedly handling up to 596,000 requests per second, while retaining overhead lower than traditional async libraries in Python. The library's design allows it to handle a million active coroutines without significant performance degradation despite Python's inherent limitations due to the GIL.

Installation and Compatibility

Runloom is available for CPython versions 3.11 to 3.14 across various operating systems including Linux, macOS, and Windows. Users can install it through pip without requiring additional compiler tools, making it accessible for developers looking to enhance Python's concurrency capabilities.

✨ This summary was generated by AI from the outlets' reporting listed below. It is not independently verified and may contain errors β€” check the original sources. How BrevFeed works β†’

Primary sources

GitHub cmc_internal/api GitHub github/collect GitHub robertsdotpm/runloom GitHub _private/browser GitHub get-started/accessibility GitHub open-source/sponsors

Reporting from

Runloom has released a library for Python that implements Go-style stackful coroutines, enabling concurrent execution across multiple cores in Python environments without the Global Interpreter Lock. This new library allows for high-throughput and low-latency networking operations by utilizing hand-crafted assembly for context switching and a C work-stealing scheduler.