Blocking on I/O

A thread can also enter the waiting state as the result of performing an input/output operation. I/O operations, such as disk writes or socket reads, are slow when compared to the execution speed of a CPU. While one thread waits for an I/O operation to complete, it is possible for other threads to perform quite a bit of processing. This is illustrated in Figure 8.3. When a thread performs an I/O operation, it enters the waiting state, where it remains until the I/O operation is completed. The thread is said to be blocked on I/O or blocking on I/O. When the I/O operation is completed, the thread transitions to the ready state.

Figure 8.3. Blocking on I/O.

Get Sun Certification Training Guide (310-025, 310-027): Java™ 2 Programmer and Developer Exams now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.