Skip to content

fs: support all executors, not just the threadpool #1178

Closed
@carllerche

Description

@carllerche

When using the curent-thread runtime, the tokio_threadpool::blocking()
function is not available, which is currently a requirement for tokio-fs to
to run blocking filesystem operations.

Note that tokio-current-thread cannot implement a function equivalent to
tokio_threadpool::blocking() because futures in this single-threaded
executor are not necessarily Send. That means we cannot start executing
the blocking function on the current thread and move the event loop onto a
new thread.

Blocking filesystem operations therefore must be run on a thread different
from the current one. Still, the solution to this problem is not as easy as
"just" spawning blocking operations onto a different thread.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions