cosmic-files/src
Michael Murphy 79aa8f887a
feat: use io_uring / IOCP when available for async file IO (#911)
Spawns a single thread for handling async file IO on the [compio runtime](https://github.com/compio-rs/compio).
It is a completion-based IO runtime that can dynamically select a polling mechanism at runtime. It defaults to
io_uring on Linux, IOCP on Windows, and the polling crate everywhere else. On Linux systems where io_uring is
unavailable or disabled, it will fall back to the polling crate.

This eliminates most of the threads that were needed previously. It significantly reduced the amount of memory
needed in the recursive Context to get a good transfer rate for each copy operation—from a 4 MB buffer to 128 KB.
Copies on a nvme drive are somewhat faster with the async IO changes, and use less CPU than before.

Although it uses a single thread for non-blocking tasks, it still manages to 100% max out my nvme drive's
activity for the whole duration of multiple long transfers. But it would be possible to enable compio's
dispatcher to spread operations across worker threads if necessary.

All but the extract and compress operations were updated to be async. I had to switch the `CondVar` in the
`Controller` to a `tokio::sync::Notify` to prevent the IO thread from being put to sleep when an operation is paused.
Fixed a deadlock in the `operation_copy` test function that was performing an operation without concurrently pulling
from the channel in the operation. Reduced the rate that `Message::None` is sent from a subscription to trigger a UI
redraw, and fixed it to not run when operations are paused.
2025-04-09 15:15:07 -06:00
..
mounter Clean up mime app handling and make it possible to set default application, part of #325 2025-01-24 11:55:56 -07:00
operation feat: use io_uring / IOCP when available for async file IO (#911) 2025-04-09 15:15:07 -06:00
app.rs feat: use io_uring / IOCP when available for async file IO (#911) 2025-04-09 15:15:07 -06:00
clipboard.rs Add more plain text mime types when copying files 2025-01-14 08:49:40 -07:00
config.rs Add 'Single click to open' settings toggle 2025-03-14 03:30:58 +01:00
dialog.rs Remove unnecessary debug output 2025-03-31 09:17:39 -06:00
key_bind.rs Format 2025-03-19 10:26:23 -06:00
lib.rs Implement "Open in new window" for Trash, Recents, Network 2025-03-07 15:33:31 -07:00
localize.rs Try LC_TIME before LANG for time localization 2024-09-01 01:30:04 -04:00
main.rs chore: update libcosmic with mmap threshold fix 2025-02-12 19:19:19 +01:00
menu.rs Use xz2 instead of liblzma, update dependencies 2025-03-31 09:05:32 -06:00
mime_app.rs feat: Open multiple files with one/multiple apps 2025-03-27 02:08:38 -04:00
mime_icon.rs Use xz2 instead of liblzma, update dependencies 2025-03-31 09:05:32 -06:00
mouse_area.rs Simplify and fix box selection and autoscroll 2025-03-22 18:51:48 -06:00
spawn_detached.rs Implement open in terminal 2024-03-04 10:28:16 -07:00
tab.rs feat: use io_uring / IOCP when available for async file IO (#911) 2025-04-09 15:15:07 -06:00
thumbnailer.rs chore(clippy): thumbnailer.rs, two files in operation 2025-01-19 10:55:41 -07:00