Quiz 3
Problem 1 (5 pt)
There are many I/O functions can provide different needs of our program. Some of them will block the user program until data are already copy into user buffer. Some of them will immediately return an error if data are not ready. Please scribe the difference of these I/O functions.
- Blocking read()
- Non-blocking read()
- sigaction()
- aio_read()
Answer
- Blocking read() will block the user process until data is copied to user buffer.
- Non-blocking read() will immediately return an error if data is not available.
- sigaction() won’t block user process and send a signal to user process after data is available.
- aio_read() won’t block user process and send a signal to user process after data is copied to user buffer.