I was reading an article that describes the switch between user-space and kernel-space that happens upon a system call. The article says

An application expects the completion of the system call before resuming user-mode execution.

Now, until now I was assuming that some system calls are blocking, whereas others are non-blocking. With the comment above, I am now confused. Does this mean that all system calls are blocking or did I misunderstand a concept?

  • $\begingroup$ @Ankit Please explain why you rolled back the edit. Note that editing to improve a post's details is standard policy on SE and does not imply an implicit critique. $\endgroup$
    – Raphael
    Mar 14 '12 at 8:52
  • $\begingroup$ @Raphael Sorry bro! I was just fiddling around and pushed the rollback by mistake and then could not find the previous version. In fact, I really liked your edit. :P $\endgroup$
    – Ankit
    Mar 14 '12 at 13:42
  • $\begingroup$ @Raphael Got it back. Actually I got duped by the revision system (did not recognize 'article' was a link). Thanks for the edits. $\endgroup$
    – Ankit
    Mar 14 '12 at 13:45
  • $\begingroup$ @Ankit: Glad I could help! $\endgroup$
    – Raphael
    Mar 14 '12 at 13:54

You seem to be overloading the term 'blocking'.

Any context switch you make to the kernel, you have to wait for it to switch back to the usermode before your application can continue. This is not what is usually called 'blocking'.

In the current kernel design, blocking calls are calls where the kernel returns only when the request is complete (or error happens). These calls usually take longer amounts of time and usually lead your process to be scheduled out. For instance, many IO calls are blocking.

There are system call which provides asynchronous IO and they are non-blocking. Note that there is still a context switch that happens here, only the application has to take care of the asynchronous nature of the call.

The paper seems to aim to do away with this context switch back and forth (exception-less system calls) and try to make all the calls asynchronous.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.