Blocked process and preempt

Hello Everyone,

There is a column kthr:b in vmstat. How a process become blocked?
If the process calls system call pread and sleeps inside it, is the process blocked in that moment?
How a process sleeping because it has no work at all (as Notepad when we are not using it) differs from a process which is sleeping because is waiting for I/O request?

Thanks

p.s.
I have written "and preempt" in the subject because wanted to ask about it, but now please ignore this part. I do not have an option to modify subject.

I don't have that column in vmstat. What's your system?

Every system call, without exception, blocks the process or thread from executing until it completes. Even the ones that always return immediately, the process has to stop in the meantime. That's just how system calls work; the process or thread is suspended until the operation completes.

User input is I/O too, reading from a socket or device or perhaps making a system call which blocks... So the mechanism is the same.

1 Like

The 2nd column (b).

So, if a process is in syscall, it will be blocked and present in the column b?

Exactly.