Originally posted by user1
View Post
Given that all file I/O on Linux is synchronous, the only way to make file system operations async is to spawn their code onto a background thread with `tokio::task::spawn_blocking()`, which returns a future for awaiting the return value of the thread.
There is also no need to worry about application freezes because the libcosmic API spawns at least one background thread for handling async tasks away from the main thread. You can choose between a single-threaded or multi-threaded executor, and the tokio runtime will automatically manage a pool a blocking threads in addition to that.
Comment