# Tokio Authors - AsyncRead and AsyncWrite (Highlights)

## Metadata
**Review**:: [readwise.io](https://readwise.io/bookreview/57073084)
**Source**:: #from/readwise #from/reader
**Zettel**:: #zettel/fleeting
**Status**:: #x
**Authors**:: [[Tokio Authors]]
**Full Title**:: AsyncRead and AsyncWrite
**Category**:: #articles #readwise/articles
**Category Icon**:: 📰
**URL**:: [tokio.rs](https://tokio.rs/tokio/tutorial/io)
**Host**:: [[tokio.rs]]
**Highlighted**:: [[2025-12-25]]
**Created**:: [[2025-12-27]]
## Highlights
- Any reader + writer type can be split using the [`io::split`](https://docs.rs/tokio/1/tokio/io/fn.split.html) utility. ([View Highlight](https://read.readwise.io/read/01kdakb0yem7q4e7qnbaes3snk)) ^969694134
- Because `io::split` supports **any** value that implements `AsyncRead + AsyncWrite` and returns independent handles, internally `io::split` uses an `Arc` and a `Mutex`. This overhead can be avoided with `TcpStream`. `TcpStream` offers two specialized split functions. ([View Highlight](https://read.readwise.io/read/01kdakbapxtg17721t7efgtdv2)) ^969694144
- [`TcpStream::split`](https://docs.rs/tokio/1/tokio/net/struct.TcpStream.html#method.split) takes a **reference** to the stream and returns a reader and writer handle. Because a reference is used, both handles must stay on the **same** task that `split()` was called from. This specialized `split` is zero-cost. There is no `Arc` or `Mutex` needed. `TcpStream` also provides [`into_split`](https://docs.rs/tokio/1/tokio/net/struct.TcpStream.html#method.into_split) which supports handles that can move across tasks at the cost of only an `Arc`. ([View Highlight](https://read.readwise.io/read/01kdakc9db0h3mh0cwdb03exmy)) ^969694170