Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion datafusion/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -498,10 +498,21 @@
//! While preparing for execution, DataFusion tries to create this many distinct
//! `async` [`Stream`]s for each [`ExecutionPlan`].
//! The [`Stream`]s for certain [`ExecutionPlan`]s, such as [`RepartitionExec`]
//! and [`CoalescePartitionsExec`], spawn [Tokio] [`task`]s, that are run by
//! and [`CoalescePartitionsExec`], spawn [Tokio] [`task`]s, that run on
//! threads managed by the [`Runtime`].
//! Many DataFusion [`Stream`]s perform CPU intensive processing.
//!
//! ### Cooperative Scheduling
//!
//! DataFusion uses cooperative scheduling, which means that each [`Stream`]
//! is responsible for yielding control back to the [`Runtime`] after
//! some amount of work is done. Please see the [`coop`] module documentation
//! for more details.
//!
//! [`coop`]: datafusion_physical_plan::coop
//!
//! ### Network I/O and CPU intensive tasks
//!
//! Using `async` for CPU intensive tasks makes it easy for [`TableProvider`]s
//! to perform network I/O using standard Rust `async` during execution.
//! However, this design also makes it very easy to mix CPU intensive and latency
Expand Down
2 changes: 1 addition & 1 deletion datafusion/physical-plan/src/coop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
//!
//! # Cooperative scheduling
//!
//! A single call to `poll_next` on a top-level `Stream` may potentially perform a lot of work
//! A single call to `poll_next` on a top-level [`Stream`] may potentially perform a lot of work
//! before it returns a `Poll::Pending`. Think for instance of calculating an aggregation over a
//! large dataset.
//! If a `Stream` runs for a long period of time without yielding back to the Tokio executor,
Expand Down