Commit Graph
3549 Commits
Author SHA1 Message Date
Uwe Klotz 9bc782acfc sync: fix incorrect comment (#6020) 2023-09-21 10:44:27 +02:00
Chris Constantine 3f6165d82e chore: prepare tokio-util v0.7.9 (#6019) tokio-util-0.7.9 2023-09-20 19:30:12 +02:00
Uwe Klotz ad7f988da3 sync: fix mark_changed when version overflows (#6017) 2023-09-19 15:44:08 +00:00
nicflower 9d51b76d01 sync: add watch::Sender::new (#5998) 2023-09-19 16:01:36 +02:00
Uwe Klotz 804511822b sync: rename watch::mark_unseen to watch::mark_changed (#6014) 2023-09-19 13:13:46 +00:00
Alexander Kirilin e6553c4ee3 sync: add Semaphore example using an Arc<Semaphore> (#5956) 2023-09-19 14:13:19 +02:00
Hayden Stainsby d247e7f5df sync: document that const_new() is not instrumented (#6002) 2023-09-13 13:49:02 +02:00
Victor Timofei 65e7715909 util: replace sync::reusable_box::Pending with std::future::Pending (#6000) 2023-09-12 08:53:05 +09:00
Victor Timofei 61042b4d90 sync: add watch::Receiver::mark_unseen (#5962) 2023-09-11 13:50:29 +02:00
Icenowy Zheng 1c428cc558 tokio: fix cache line size for RISC-V (#5994) 2023-09-11 07:22:14 +00:00
Alexandre Bléron 61f095fdc1 sync: add ?Sized bound to {MutexGuard,OwnedMutexGuard}::map (#5997) 2023-09-10 20:08:12 +02:00
Marek Kuskowski 65027b60bc io: add Interest::remove method (#5906) 2023-09-10 16:46:07 +02:00
M.Amin Rayej b046c0dcbb benches: use criterion instead of bencher (#5981) 2023-09-10 16:42:53 +02:00
Adam Chalmers 737dff40cb task: rename generic paramter for spawn (#5993) 2023-09-10 11:21:51 +02:00
Weijia Jiang a6be73eecb codec: document the line ending used by LinesCodec (#5982) 2023-09-08 15:59:48 +02:00
M.Amin Rayej 9fafe783d3 io: support vectored writes for DuplexStream (#5985) 2023-09-08 12:57:18 +02:00
Joan Antoni RE fb3ae0a254 docs: fix worker_overflow_count (#5988) 2023-09-07 14:16:52 -05:00
Hayden Stainsby aad1892ab5 task: fix spawn_local source location (#5984)
The location of a spawned task, as shown in tokio console, is taken from
the location set on the tracing span that instruments the task. For this
location to work, there must be unbroken chain of functions instrumented
with `#[track_caller]`.

For `task::spawn_local`, there was a break in this chain and so the
span contained the location of an internal function in tokio.

This change adds the missing `#[track_caller]` attribute. It has been
tested locally as automated tests would really need `tracing-mock` to be
published so we can use it in the tokio tests.
2023-09-06 10:55:47 +02:00
Hayden Stainsby 8ea303e027 chore: list 1.32.x as LTS release (#5980) 2023-09-05 10:02:50 +02:00
M.Amin Rayej 84ed35ef70 process: document that Child::wait is cancel safe (#5977) 2023-09-04 10:24:55 +02:00
Jack Wrenn 95fb599664 tokio: render taskdump documentation on docs.rs (#5972)
Modifies `package.metadata.docs.r` so that `--cfg tokio_taskdump`
is used by docs.rs when building documentation.
2023-09-02 11:43:31 +02:00
ComplexSpaces 8b312ee571 macros: use ::core qualified imports instead of ::std inside tokio::test macro (#5973) 2023-09-02 03:44:08 +09:00
Colin Walters fd7d0ad5e5 io: add SyncIOBridge::into_inner (#5971) 2023-09-01 13:01:22 +00:00
M.Amin Rayej 37bb47c4a2 fs: add vectored writes to tokio::fs::File (#5958) 2023-08-29 14:18:16 +02:00
Rain cb1e10b745 sync: improve docs for watch channels (#5954)
## Motivation

I found the watch docs as written to be somewhat confusing.

* It wasn't clear to me whether values are marked seen or not at
  creation/subscribe time.
* The example also confused me a bit, suggesting a while loop when a
  do-while loop is generally more correct.
* I noticed a potential race with `borrow` that is no longer an issue
  with `borrow_and_update`.

## Solution

Update the documentation for the watch module to try and make all this
clearer.
2023-08-28 16:13:07 -07:00
Alice Ryhl fb3028f3a2 test: fix testing category slug (#5953) 2023-08-26 17:09:49 +02:00
Alice Ryhl b45f5831cf tokio: remove stats feature (#5952) 2023-08-26 17:09:33 +02:00
Rain 0fe24fcffa sync: improve cancel-safety documentation for mpsc::Sender::send (#5947)
This specific issue (data loss because a send got cancelled) has bitten
our team a couple of times over the last few months. We've switched to
recommending this kind of reserve pattern instead.
2023-08-25 22:03:23 +00:00
Eliza Weisman d1dae25cd2 ci: drop MIPS targets from cross-check (#5951)
Currently, Tokio runs cross-compilation checks for the
`mips-unknown-linux-gnu` and `mipsel-unknown-linux-musl` target triples.
However, Rust has recently demoted these targets from Tier 2 support to
Tier 3 (see rust-lang/compiler-team#648). Therefore, MIPS toolchains may
not always be available, even in stable releases. This is currently
[breaking our CI builds][1], as Rust 1.72.0 does not contain a standard
library for `mips-unknown-linux-gnu`.

This branch removes these builds from the cross-compilation check's
build matrix. Tokio may still build successfully for MIPS targets, but
we can't easily guarantee support when the stable Rust release train may
or may not be able to build for MIPS targets.

[1]: https://github.com/tokio-rs/tokio/actions/runs/5970263562/job/16197657405?pr=5947#step:3:80
2023-08-25 14:40:32 -07:00
nicflower 59c9364689 io: pass through IO traits for StreamReader and SinkWriter (#5941) 2023-08-23 17:46:39 +00:00
Alice Ryhl 3b79be624d chore: prepare tokio-test v0.4.3 (#5943) tokio-test-0.4.3 2023-08-23 12:38:11 +02:00
Jiahao XU 8955ed5f85 sync: add const fn OnceCell::from_value (#5903)
Signed-off-by: Jiahao XU <[email protected]>
2023-08-22 13:32:56 +02:00
Matilda Smeds bc26934e3b sync: add Semaphore example that limits open files (#5939) 2023-08-20 12:14:41 +02:00
Hamza Jadid 3d64a06600 docs: added trailing backticks (#5938) 2023-08-17 17:22:34 -05:00
Carl Lerche a7d52c2fed chore: prepare Tokio v1.32.0 release (#5937) tokio-1.32.0 2023-08-16 14:11:30 -07:00
Marek Kuskowski f5f2b58b8d rt: improve docs for Builder::max_blocking_threads (#5793)
Closes #5777
2023-08-16 12:12:53 -07:00
mahkoh 718dcc8dff docs: BytesMut::with_capacity does not guarantee exact capacity (#5870) 2023-08-16 10:29:29 -07:00
Folkert de Vries 10e141d211 io: add Ready::ERROR and report error readiness (#5781)
Add `Ready::ERROR` enabling callers to specify interest in error readiness. Some platforms use error
readiness notifications to notify of other events. For example, Linux uses error to notify receipt of
messages on a UDP socket's error queue.

Using error readiness is platform specific.

Closes #5716
2023-08-16 10:28:19 -07:00
Carl Lerche 6e42c26c80 rt(alt): tweak some constants to improve scalability (#5935)
This patch aims to reduce the number of threads that get no-op wakeups.
2023-08-16 08:20:48 -07:00
Folkert de Vries 82bef00db4 io: minor tweaks to AsyncFd (#5932) 2023-08-14 19:13:14 +02:00
Alice Ryhl 40633fc678 readme: list previous LTS releases (#5931) 2023-08-14 19:10:24 +02:00
Aspen Smith 3dd5f7ae2e sync: move broadcast waiters into separate list before waking (#5925)
Within `notify_rx`, looping while re-locking and re-reading from
`Shared.tail` as long as there are still available wakers causes a
quadratic slowdown as receivers which are looping receiving from the
channel are added. Instead of continually re-reading from the original
list, this commit modifies `notify_rx` to move the waiters into a
separate list immediately similar to how `Notify::notify_waiters` works,
using a new `WaitersList` struct modified after NotifyWaitersList.

Fixes #5923
2023-08-14 19:09:56 +02:00
Félix Saparelli 2c92cad9db process: stabilize Command::raw_arg (#5930) 2023-08-13 10:03:11 +02:00
joe thomas 197757d440 streams: create StreamMock for testing Streams (#5915)
Introduce a new mock type to tests streams and eventually
sinks. Only includes next() and wait() for now. Fixes #4106
2023-08-12 19:18:23 +00:00
Carl Lerche 8b8005ebdd chore: prepare Tokio v1.31.0 release (#5928) tokio-1.31.0 2023-08-12 09:37:49 -07:00
Carl Lerche 6cb106c353 rt: unstable EWMA poll time metric (#5927)
Because the runtime uses this value as a tuning heuristic, it can be
useful to get its value. This patch exposes the value as an unstable
metric.
2023-08-10 19:43:44 +00:00
Carl Lerche dd23f08c3a rt(alt): fix memory leak and increase max preemption when running Loom CI tests (#5911)
The memory leak was caused by a bug during shutdown where some state was leaked.
2023-08-10 09:18:10 -07:00
Jakub Kubík 5d29bdfb0c io: delegate WriteHalf::poll_write_vectored (#5914) 2023-08-10 10:11:00 +02:00
Brian Cardarella 4c220af777 chore: prepare Tokio v1.30.0 release (#5917) tokio-1.30.0 2023-08-09 15:16:11 +00:00
Jiahao XU 0a631f88e8 process: add {ChildStd*}::into_owned_{fd, handle} (#5899) 2023-08-09 16:04:53 +02:00