Is it beneficial to perform disk-IO concurrently?

28 Views Asked by At

I have a misunderstanding and I can't really be sure about it, firstly, just to be clear, I talk about an environment where we have an async-runtime that can run "user-level" threads/co-routines, for example (tokio for Rust, or the goroutines in Go), and the co-routines work strictly inside a single thread (although the single thread is capable of running multiple co-routines).

(As to my knowledge) it wouldn't be beneficial to run CPU-bounded tasks concurrently in an environment like this (correct me if wrong please) because although tasks would run in separate co-routines, it is just a single hardware thread that works on executing those co-routines concurrently.

Now, regarding Disk-IO, my question is would it be beneficial to run tasks that perform Disk-IO in separate co-routines concurrently although it is just a single hardware thread that executes the co-routines? in another form, are the underlying OS Disk-IO syscalls non-blocking? so that if a co-routine asked to write to a file (which I consider as a yield point, so the hardware thread should switch to other co-routines that would also perform Disk-IO until this co-routine finishes its Disk-IO, will this co-routine also be able to perform its Disk-IO or would it be blocked?).

Please correct me if at any point I said something that isn't correct.

0

There are 0 best solutions below