4. Five IO models
blocking I/O: blocked all the way
non-blocking I/O: if no data in buffer, immediate
returns EWOULDBLOCK
I/O multiplexing (select and poll): blocked
separately in wait and copy
signal driven I/O (SIGIO): non-blocked in wait
but blocked in copy (signaled when I/O can be
initiated)
asynchronous I/O (aio_): non-blocked all the way
(signaled when I/O is complete)
Kernel’s
buffer
IO
Device
User
process
Wait for data
copy date
(system call)
6. Select
1.Is the device readyfor reading? (writing
2.Kernel check the device buffer’s limits
->READY for reading(writing
3.Select return
IO Device
Kernel’s
buffer
User
process
INTPUT OUTPUT
4.Copy data by system
call(READ WRITE
no yes
4. next Select()