HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
tokio-rs
tokio
Rust2016–2026
tokio-rs / tokio

tokio

A runtime for writing reliable asynchronous applications with Rust. Provides I/O, networking, scheduling, timers, ...

43Distinct people
49Mentions
1Explicit recommenders
33.7KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

A runtime for writing reliable asynchronous applications with Rust. Provides I/O, networking, scheduling, timers, ...

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

Tokio author here. Generally speaking, I recommend strongly against using FuturesUnordered unless you know all the pitfalls. We are working on an alternative utility that…

carllerche used a recommendation phrase. One indexed comment matches. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 9–Nov 16 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/16/2026, 4:35:25 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year49 dated mentions

Observed mentions: 2016-08-05 18:35:46 UTC to 2026-09-14 22:05:26 UTC.

02468102016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 5 mentions; 0 submissions, 5 comments20162017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 10 mentions; 3 submissions, 7 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 5 mentions; 0 submissions, 5 comments20212022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 5 mentions; 0 submissions, 5 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 4 mentions; 1 submissions, 3 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 7 mentions; 0 submissions, 7 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC505
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC202
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC303
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC404
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC1037
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC505
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC505
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC303
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC413
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC707
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC101

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
Tokio A runtime for writing reliable, asynchronous, and slim applications with the Rust programming language. It is: Fast: Tokio's zero-cost abstractions give you bare-metal performance. Reliable: Tokio leverages Rust's ownership, type system, and concurrency model to reduce bugs and ensure thread safety. Scalable: Tokio has a minimal footprint, and handles backpressure and cancellation naturally. Website | Guides | API Docs | Chat Overview Tokio is an event-driven, non-blocking I/O platform for writing asynchronous applications with the Rust programming language. At a high level, it provides a few major components: A multithreaded, work-stealing based task scheduler. A reactor backed by the operating system's event queue (epoll, kqueue, IOCP, etc.). Asynchronous TCP and UDP sockets. These components provide the runtime components necessary for building an asynchronous application. Example A basic TCP echo server with Tokio. Make sure you enable the full features of the tokio crate on Cargo.toml: [dependencies] tokio = { version = "1.54.1", features = ["full"] } Then, on your main.rs: use tokio::net::TcpListener; use tokio::io::{AsyncReadExt, AsyncWriteExt}; #[tokio::main] async fn main() -> Result<(), Box<dyn std::error::Error>> { let listener = TcpListener::bind("127.0.0.1:8080").await?; loop { let (mut socket, _) = listener.accept().await?; tokio::spawn(async move { let mut buf = [0; 1024]; // In a loop, read data from the socket and write the data back. loop { let n = match socket.read(&mut buf).await { // socket closed Ok(0) => return, Ok(n) => n, Err(e) => { eprintln!("failed to read from socket; err = {:?}", e); return; } }; // Write the data back if let Err(e) = socket.write_all(&buf[0..n]).await { eprintln!("failed to write to socket; err = {:?}", e); return; } } }); } } More examples can be found here. For a larger "real world" example, see the mini-redis repository. To see a list of the available feature flags that can be enabled, check our docs. Getting Help First, see if the answer to your question can be found in the Guides or the API documentation. If the answer is not there, there is an active community in the Tokio Discord server. We would be happy to try to answer your question. You can also ask your question on the discussions page. Contributing 🎈 Thanks for your help improving the project! We are so happy to have you! We have a contributing guide to help you get involved in the Tokio project. Related Projects In addition to the crates in this repository, the Tokio project also maintains several other libraries, including: toasty: An async ORM for Rust supporting both SQL and NoSQL databases. axum: A web application framework that focuses on ergonomics and modularity. hyper: A fast and correct HTTP/1.1 and HTTP/2 implementation for Rust. tonic: A gRPC over HTTP/2 implementation focused on high performance, interoperability, and flexibility. warp: A super-easy, composable, web server framework for warp speeds. tower: A library of modular and reusable components for building robust networking clients and servers. tracing (formerly tokio-trace): A framework for application-level tracing and async-aware diagnostics. mio: A low-level, cross-platform abstraction over OS I/O APIs that powers tokio. bytes: Utilities for working with bytes, including efficient byte buffers. loom: A testing tool for concurrent Rust code. Changelog The Tokio repository contains multiple crates. Each crate has its own changelog. tokio - view changelog tokio-util - view changelog tokio-stream - view changelog tokio-macros - view changelog tokio-test - view changelog Supported Rust Versions Tokio will keep a rolling MSRV (minimum supported rust version) policy of at least 6 months. When increasing the MSRV, the new Rust version must have been released at least six months ago. The current MSRV is 1.85. Note that the MSRV is not increased automatically, and only as part of a minor release. The MSRV history for past minor releases can be found below: 1.54 to now - Rust 1.85 1.48 to 1.53 - Rust 1.71 1.39 to 1.47 - Rust 1.70 1.30 to 1.38 - Rust 1.63 1.27 to 1.29 - Rust 1.56 1.17 to 1.26 - Rust 1.49 1.15 to 1.16 - Rust 1.46 1.0 to 1.14 - Rust 1.45 Note that although we try to avoid the situation where a dependency transitively increases the MSRV of Tokio, we do not guarantee that this does not happen. However, every minor release will have some set of versions of dependencies that works with the MSRV of that minor release. Release schedule Tokio doesn't follow a fixed release schedule, but we typically make one minor release each month. We make patch releases for bugfixes as necessary. Bug patching policy For the purposes of making patch releases with bugfixes, we have designated certain minor releases as LTS (long term support) releases. Whenever a bug warrants a patch release with a fix for the bug, it will be backported and released as a new patch release for each LTS minor version. Our current LTS releases are: 1.51.x - LTS release until March 2027. (MSRV 1.71) 1.53.x - LTS release until September 2027. (MSRV 1.71) Each LTS release will continue to receive backported fixes for at least a year. If you wish to use a fixed minor release in your project, we recommend that you use an LTS release. To use a fixed minor version, you can specify the version with a tilde. For example, to specify that you wish to use the newest 1.51.x patch release, you can use the following dependency specification: tokio = { version = "~1.51", features = [...] } Previous LTS releases 1.8.x - LTS release until February 2022. 1.14.x
Read the full README on GitHub

What Hacker News says

5 sources
I don't think tokio's slowness here is "to be expected". There isn't much reason for tokio tasks to have that much overhead over normal thread pools. The I/O driver shouldn't be called in such a benchmark given there's no I/O work happening. Waker's only add a reference count inc/dec + an atomic cas for wake() which should only happen on the JoinHandle `awaits` [4] compared to just an atomic swap for the Zig case on the join handle. Golang doesn't poll for I/O under such cases [0] and tokio should be using the `ParkThread` parker for putting threads to sleep [1] given `net` features aren't enabled (not sure if this is the actually the case) which you can force with a custom Runtime initialization instead of `#[tokio::main]` as an exercise. `crossbeam-deque` requires heap allocation for the run queues, heap allocates on growth, and garbage
Read the rest
collects said memory. This is an overhead I wished to avoid and is something tokio has been improvements with avoiding as well [2]. `rayon` isn't a good comparison here given `rayon::join` is optimized to hook directly into the scheduler and run the caller only until the other forked-section completes [3]. This isn't general purpose and it takes advantage of unbounded stack allocation which can technically cause a stack overflow. Zig could do this and also take advantage of batch scheduling, but it complicates the code and is unfair here given `async` usage. Tokio, golang, and the Zig benchmarks require heap allocation on spawn so I believe it makes it a fairer comparison. This is also why I used rayon scopes instead of join(): less specialization and reintroduced the heap allocation from the unbounded concurrency. The `unsafe` there is from me copying the benchmark code from the tokio version to the rayon version and forgetting to remove the hack. In tokio, ownership of the array needed to be passed into the function given the lifetime was no longer linear from the spawn() I assume (correct me if i'm wrong here, but this is what the compile error hinted at). So I needed to recreate the array after the function, hence unsafe. If there's a better way for the tokio version, please send a PR. I see you've done so for the rayon version and I gladly merged it. [0]: See `atomic.Load(&netpollWaiters) > 0` in https://golang.org/src/runtime/proc.go [1]: https://github.com/tokio-rs/tokio/blob/master/tokio/src/runt... [2]: https://tokio.rs/blog/2019-10-scheduler#a-better-run-queue [3]: https://docs.rs/rayon-core/1.9.1/src/rayon_core/join/mod.rs.... [4]: https://github.com/tokio-rs/tokio/blob/98578a6f4a494e709f000...
In Resource efficient Thread Pools with Zig
Multiple event loop integration is something projects get to very late in their lifecycle, if they ever get to it at all. Tokio is no exception: https://github.com/tokio-rs/tokio/issues/2443 When I used to write more networking C code, I used to be careful to write my libraries to be event loop agnostic. And if my library had its own event loop, I made sure that it could be stepped independently so it could sit atop another application event loop. This is alot easier on modern Unix systems because kqueue and epoll can be stacked--you can poll a kqueue/epoll descriptor from another kqueue/epoll descriptor, so sockets, timers, etc registered with the first will bubble up to the parent and your library-specific event loop can just export a single file descriptor to be polled by another event loop.[1] Windows doesn't have such a capability so
Read the rest
there's no simple way to bubble events. Of course, you can run your different event loops in different threads, but then you have to deal with the nightmare of shared data multithreading. Rust makes multi-threading "fearless" because it heavily restricts multiple threads from holding references to the same object, so Rust doesn't help in this regard, especially considering you're integrating with non-Rust code and, worst of all, GUI APIs, which tend to be some of the most inscrutable and hostile code with which to integrate. [1] This is effectively structured concurrency as a first-class kernel interface, an elegant characteristic of kqueue and epoll that is sorely underappreciated and rarely used.
In The Persistent Gravity of Cross Platform
You can do it for Rust threads - but it gets tricky with Rust coroutines (async functions). I made an attempt of implementing it for async Rust in https://github.com/tokio-rs/tokio/issues/1879 with a concrete implementation in https://github.com/tokio-rs/tokio/pull/2579 It mostly follows the Kotlin model of structured concurrency. However it has its sets of drawbacks due to Rust Futures being immediately cancellable, which then leads to problem if a parent task gets simply dropped. In order to handle that case better I've written a proposal for async functions that run to completion with https://rust-lang.zulipchat.com/#narrow/stream/187312-wg-asy... . However that is all theoretical, and might never see the light of the day.
In Libdill: Structured Concurrency for C (2016)

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.