+1 vote
91 views
in Compilers & Operating Systems by

1 Answer

+1 vote
by
selected by (user.guest)
 
Best answer

Blocking v. Nonblocking I/O

From the programmer’s point of view, I/O system calls exhibit one of three kinds of behaviour: 

1. Blocking: process suspended until I/O completed

• easy to use and understand.

• insufficient for some needs.

2. Nonblocking: I/O call returns as much as available

• returns almost immediately with count of bytes read or written (possibly 0).

• can be used by e.g. user interface code.

• essentially application-level “polled I/O”.

3. Asynchronous: process continues to run while I/O executes

• I/O subsystem explicitly signals process when its I/O request has completed.

• most flexible (and potentially efficient).

• . . . but also most difficult to use.

Most systems provide both blocking and non-blocking I/O interfaces; modern s systems(e.g. NT, Linux) also support asynchronous I/O, but used Infrequently.

Other I/O Issues

• Caching: fast memory holding copy of data

– can work with both reads and writes

– key to I/O performance

Scheduling:

– e.g. ordering I/O requests via per-device queue

– some operating systems try fairness. . .

Spooling: queue output for a device

– useful for “single user” devices which can serve only one request at a time (e.g. printer)

Device reservation:

– system calls for acquiring or releasing exclusive access to a device (careful!).

Error handling:

– e.g. recover from disk read, device unavailable, transient write failures, etc.

– most I/O system calls return an error number or code when an I/O request fails.

– system error logs hold problem reports.


Related questions

+1 vote
1 answer 2.0k views
+1 vote
1 answer 158 views
asked Sep 17, 2021 in Computer Architecture by anonymous
+1 vote
1 answer 164 views
+1 vote
1 answer 158 views
asked Sep 30, 2021 in Computer Architecture by anonymous
0 votes
0 answers 287 views
+2 votes
1 answer 2.3k views
+3 votes
1 answer 6.6k views
+2 votes
1 answer 5.9k views
+1 vote
1 answer 158 views
0 votes
1 answer 130 views
+3 votes
1 answer 8.9k views
+1 vote
1 answer 1.9k views
+1 vote
1 answer 179 views
+1 vote
1 answer 306 views
+1 vote
1 answer 215 views
+1 vote
1 answer 68 views
+1 vote
1 answer 121 views
+1 vote
1 answer 176 views
+1 vote
1 answer 436 views
+1 vote
1 answer 1.3k views
0 votes
0 answers 70 views
asked Sep 27, 2021 in Law for Engineers by anonymous
0 votes
1 answer 169 views
+1 vote
1 answer 1.0k views
Welcome to CPENTalk.com
Solution-oriented students of computer engineering on one platform to get you that

ONE SOLUTION

...