Machine-translated by Google. Questions are authored in English.
Top

Discussion

A blocking driver read returns

  • A.only when the device is closed by the caller
  • B.when the data is available or the timeout expires
  • C.immediately, with however much data is ready
  • D.immediately, with an error returned if no data happens to be ready

Answer: B

Blocking suits a task that has nothing else to do and keeps the calling code simple, since the data is there when the call returns. Non-blocking suits a task with other work and pushes the retry logic up into the caller.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.