Skip to content

Using ThreadPool for blocking I/O? #779

@couchand

Description

@couchand

Is it a legitimate use of this crate's ThreadPool for managing blocking I/O? The only reference I can find in any documentation is a terse warning on the top-level join docs:

If you do perform I/O, and that I/O should block (e.g., waiting for a network request), the overall performance may be poor.

What does "overall performance may be poor" mean specifically?

Also, is that warning:

  • Limited to the top-level join?
  • Also applicable to the join associated function on ThreadPool?
  • Also applicable to scope and spawn?

Is there an acceptable usage pattern for blocking I/O? Is the use of rayon for concurrent blocking I/O to be avoided entirely? If so, what crate should I look to for a thread pool for blocking I/O?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions