Skip to content

OS-Native Async IO Support #20482

@james7132

Description

@james7132

What problem does this solve or what need does it fill?

Right now, our local file reads are done with async-fs, backed by the blocking crate, to run a dynamic thread pool for running blocking IO operations

This thread pool does its job, but may result in higher counts of context switches with the threads periodically returning control to the OS with each syscall.

What solution would you like?

Incorporate the use of OS-level async IO systems (i.e. io_uring on Linux, IORing on Windows) to lower our reliance on this blocking thread pool ,and stick as close as we can to a single thread per core for the engine as a whole.

This is already generally well supported within the Rust ecosystem for network IO via epoll, kqueue, and IOCP, but it does not support file IO, and it's been shown that io_uring and IORing are overall more CPU-time efficient than these options.

What alternative(s) have you considered?

Sticking to what we have right now. It works just fine.

Additional context

io_uring may not be compatible with async Rust as it is right now: https://tonbo.io/blog/async-rust-is-not-safe-with-io-uring. More ecosystem-wide support might be required.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-AssetsLoad files from disk to use for things like images, models, and soundsA-NetworkingSending data between clients, servers and machinesA-TasksTools for parallel and async workC-FeatureA new feature, making something new possibleC-PerformanceA change motivated by improving speed, memory usage or compile timesO-LinuxSpecific to the Linux desktop operating systemO-MacOSSpecific to the MacOS (Apple) desktop operating systemO-WindowsSpecific to the Windows desktop operating system

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions