Re: "This method blocks until..." means what exactly?
On 30/07/10 20:38, Screamin Lord Byron wrote:
On 30.07.2010 12:20, Nigel Wade wrote:
I infer "blocking" to imply:
a) no useful work is being performed
b) the duration is indeterminate (usually due to external factors)
whether it yields the CPU to other threads, or spins, isn't material to
the meaning of "blocked" - it may do either.
Wouldn't you say that a function which does some time consuming
cryptographic computation (like generating long RSA keypairs) blocks if
it doesn't return before the computation is finished?
No, I wouldn't.
To me, if it's actually performing its allotted task then it's running,
not blocked. If it were blocked then it would be doing nothing, unable
to perform it's required task (generally because it's waiting for some
event to occur). That's why the term "blocked" is used (similar to when
a road is blocked), it can't perform its function because something is
preventing it. If it's running, doing what it's meant to do, I would not
consider it blocked.
--
Nigel Wade