mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-20 00:00:08 +02:00
Provides a thread pool dedicated to running blocking operations (#588) and update `tokio-fs` to use this pool. In an effort to make incremental progress, this is an initial step towards a final solution. First, it provides a very basic pool implementation with the intend that the pool will be replaced before the final release. Second, it updates `tokio-fs` to always use this blocking pool instead of conditionally using `threadpool::blocking`. Issue #588 contains additional discussion around potential improvements to the "blocking for all" strategy. The implementation provided here builds on work started in #954 and continued in #1045. The general idea is th same as #1045, but the PR improves on some of the details: * The number of explicit operations tracked by `File` is reduced only to the ones that could interact. All other ops are spawned on the blocking pool without being tracked by the `File` instance. * The `seek` implementation is not backed by a trait and `poll_seek` function. This avoids the question of how to model non-blocking seeks on top of a blocking file. In this patch, `seek` is represented as an `async fn`. If the associated future is dropped before the caller observes the return value, we make no effort to define the state in which the file ends up.
65 lines
1.8 KiB
TOML
65 lines
1.8 KiB
TOML
[package]
|
|
name = "tokio-executor"
|
|
# When releasing to crates.io:
|
|
# - Remove path dependencies
|
|
# - Update html_root_url.
|
|
# - Update doc url
|
|
# - Cargo.toml
|
|
# - Update CHANGELOG.md.
|
|
# - Create "v0.2.x" git tag.
|
|
version = "0.2.0-alpha.2"
|
|
edition = "2018"
|
|
documentation = "https://docs.rs/tokio-executor/0.2.0-alpha.2/tokio_executor"
|
|
repository = "https://github.com/tokio-rs/tokio"
|
|
homepage = "https://github.com/tokio-rs/tokio"
|
|
license = "MIT"
|
|
authors = ["Tokio Contributors <[email protected]>"]
|
|
description = """
|
|
Future execution primitives
|
|
"""
|
|
keywords = ["futures", "tokio"]
|
|
categories = ["concurrency", "asynchronous"]
|
|
|
|
[features]
|
|
blocking = ["tokio-sync"]
|
|
current-thread = ["crossbeam-channel"]
|
|
threadpool = [
|
|
"tokio-sync",
|
|
"crossbeam-deque",
|
|
"crossbeam-queue",
|
|
"crossbeam-utils",
|
|
"futures-core-preview",
|
|
"futures-util-preview",
|
|
"num_cpus",
|
|
"lazy_static",
|
|
"slab",
|
|
]
|
|
|
|
[dependencies]
|
|
tokio-sync = { version = "=0.2.0-alpha.2", optional = true, path = "../tokio-sync" }
|
|
|
|
tracing = { version = "0.1.5", optional = true }
|
|
|
|
# current-thread dependencies
|
|
crossbeam-channel = { version = "0.3.8", optional = true }
|
|
|
|
# threadpool dependencies
|
|
crossbeam-deque = { version = "0.7.0", optional = true }
|
|
crossbeam-queue = { version = "0.1.0", optional = true }
|
|
crossbeam-utils = { version = "0.6.4", optional = true }
|
|
futures-core-preview = { version = "=0.3.0-alpha.18", optional = true }
|
|
futures-util-preview = { version = "=0.3.0-alpha.18", optional = true }
|
|
num_cpus = { version = "1.2", optional = true }
|
|
lazy_static = { version = "1", optional = true }
|
|
slab = { version = "0.4.1", optional = true }
|
|
|
|
[dev-dependencies]
|
|
tokio = { version = "0.2.0-alpha.1", path = "../tokio" }
|
|
tokio-test = { version = "0.2.0-alpha.1", path = "../tokio-test" }
|
|
|
|
futures-core-preview = "=0.3.0-alpha.18"
|
|
rand = "0.7"
|
|
|
|
[package.metadata.docs.rs]
|
|
all-features = true
|