File tree 2 files changed +24
-6
lines changed
2 files changed +24
-6
lines changed Original file line number Diff line number Diff line change 431
431
//! number of permits, which tasks may request in order to enter a critical
432
432
//! section. Semaphores are useful for implementing limiting or bounding of
433
433
//! any kind.
434
+ //!
435
+ //! # Runtime compatibility
436
+ //!
437
+ //! All synchronization primitives provided in this module are runtime agnostic.
438
+ //! You can freely move them between different instances of the Tokio runtime
439
+ //! or even use them from non-Tokio runtimes.
440
+ //!
441
+ //! When used in a Tokio runtime, the synchronization primitives participate in
442
+ //! [cooperative scheduling](crate::task#cooperative-scheduling) to avoid
443
+ //! starvation. This feature does not apply when used from non-Tokio runtimes.
444
+ //!
445
+ //! As an exception, methods ending in `_timeout` are not runtime agnostic
446
+ //! because they require access to the Tokio timer. See the documentation of
447
+ //! each `*_timeout` method for more information on its use.
434
448
435
449
cfg_sync ! {
436
450
/// Named future types.
Original file line number Diff line number Diff line change 70
70
//!
71
71
//! # Multiple runtimes
72
72
//!
73
- //! The mpsc channel does not care about which runtime you use it in, and can be
74
- //! used to send messages from one runtime to another. It can also be used in
75
- //! non-Tokio runtimes.
73
+ //! The ` mpsc` channel is runtime agnostic. You can freely move it between
74
+ //! different instances of the Tokio runtime or even use it from non-Tokio
75
+ //! runtimes.
76
76
//!
77
- //! There is one exception to the above: the [`send_timeout`] must be used from
78
- //! within a Tokio runtime, however it is still not tied to one specific Tokio
79
- //! runtime, and the sender may be moved from one Tokio runtime to another.
77
+ //! When used in a Tokio runtime, it participates in
78
+ //! [cooperative scheduling](crate::task#cooperative-scheduling) to avoid
79
+ //! starvation. This feature does not apply when used from non-Tokio runtimes.
80
+ //!
81
+ //! As an exception, methods ending in `_timeout` are not runtime agnostic
82
+ //! because they require access to the Tokio timer. See the documentation of
83
+ //! each `*_timeout` method for more information on its use.
80
84
//!
81
85
//! # Allocation behavior
82
86
//!
You can’t perform that action at this time.
0 commit comments