What are linux blocking and non blocking calls

Asked by Gaurav Pawaskar

I want to know what is meaning of linux blocking and non blocking calls. Is it related to thread, IO, process or something else?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu linux Edit question
Assignee:
No assignee Edit question
Solved by:
marcobra (Marco Braida)
Solved:
Last query:
Last reply:
Revision history for this message
Best marcobra (Marco Braida) (marcobra) said :
#1

go to "open() in non-blocking mode" into this doc http://davmac.org/davpage/linux/async-io.html

Revision history for this message
mycae (mycae) said :
#2

Blocking and non-blocking descriptions tell you about program flow.

if I have a function

"doTheThing()"

and I write

print "doing the thing"
doTheThing()
print "done the thing"

By definitiniton a blocking function is one where I can be certain that "the thing" will have been done when the function "doTheThing" finishes.

On the other hand, I cannot be sure that a non-blocking thing will have finished doing whatever it was supposed to when I finish the function call. All I know is that I have initiated the "doingTheThing" process, and it will complete at some point.

Usually non-blocking calls have a blocking check function that you can use later to confirm that the action had completed.

Revision history for this message
Gaurav Pawaskar (gaurav-pawaskar) said :
#3

Thanks marcobra (Marco Braida), that solved my question.