This isn't related directly but is something that's just come to my mind. If a process is in the middle of being executed by the CPU and is then put into the READY queue, would that corrupt something?
I imagine what it would be like if I were to just remove a USB drive while transferring data, I assume that I've potentially messed up some stuff on the drive by doing that so abruptly.
In this sort of case where a process like writing to a device is suddenly put to the READY queue because of the time-quantum 'expiring' for that process, is this something that could actually happen?
Is preventing this the job of the processes that run during the 'TIME_CORE_STATE_TRANSITIONS' and 'TIME_CONTEXT_SWITCH' times?
For example:
When using the 'TIME_CORE_STATE_TRANSITIONS', this would be the amount of time it would take for the CPU to safely transition from Running -> Blocked/Ready or Blocked -> Ready?
I hope I asked my question well as I think the idea of, say writing data to an I/O device and then having it be cut off without it causing issue 'just because' is really weird. I am curious about what allows for such things to be interrupted without issue.
Thanks.