4

Suppose a process is running and it invokes a system call . Does that means that process will now be blocked . Are all system calls block a process and changes its state from running to block ? Or it depends on the scenario at that time?

Utkarsh Srivastav
  • 3,105
  • 7
  • 34
  • 53

2 Answers2

3

No, it does not mean the process is blocked. Some system calls are blocking and some are not. However, note that for the duration of the time the kernel processes the system call, while the process continues to run, your own user code is not executing but the kernel code is executing on behalf of the process.

gby
  • 14,900
  • 40
  • 57
1

Some operating systems have even upcalls, where the user application registers some functions to be called by the kernel (back in userspace) at some occasions. The Unix signal machinery is a very simple example, but some OSes have much more complex upcalls.

I think there are some OSes where a syscall trigger some kernel processing which may trigger some upcall back in userspace.

I forgot the details

Basile Starynkevitch
  • 223,805
  • 18
  • 296
  • 547