Esmond Pitt wrote:
On 29/07/2010 7:21 PM, Arved Sandstrom wrote:
A "blocking" function doesn't return until its work is completed.
Period.
But *all* functions have that characteristic (except for specifically
designated async functions that generally post results via callbacks).
It's just not a useful definition. You can't usefully regard 'still
running' or 'hasn't returned yet' as 'blocking'. 'Blocked' generally
means waiting for something *else*, e.g. in this case waiting for the
kernel or the network to deliver some data.
As general as it may be, it's actually still a useful definition,
because we invariably use it only for those functions where there can be
a significant delay before the work associated with the function
completes. You _could_ use the term for a function that adds two
integers, but nobody would bother, it serves no purpose.
So the way you phrased it in your last sentence is usually *when* and
*where* we tend to use this general definition. It doesn't change the
fact that it's a general definition.
AHS
the meaning of "blocked" - it may do either.