Podcast
Questions and Answers
What is the main issue with handling input from a TCP socket?
What is the main issue with handling input from a TCP socket?
Non-determinism and concurrency
What is one solution to handle non-determinism and concurrency in I/O operations?
What is one solution to handle non-determinism and concurrency in I/O operations?
Use nonblocking I/O
How can the O_NONBLOCK flag be set using fcntl()?
How can the O_NONBLOCK flag be set using fcntl()?
flags = fcntl(sock,F_GETFL,0); fcntl(sock,F_SETFL,flags | O_NONBLOCK);
What happens when a process uses nonblocking I/O and no input is available?
What happens when a process uses nonblocking I/O and no input is available?
Signup and view all the answers
What is the advantage of using blocking I/O over nonblocking I/O?
What is the advantage of using blocking I/O over nonblocking I/O?
Signup and view all the answers
What is the downside of using nonblocking I/O?
What is the downside of using nonblocking I/O?
Signup and view all the answers
What is an alternative solution to nonblocking I/O for handling concurrency and I/O non-determinism?
What is an alternative solution to nonblocking I/O for handling concurrency and I/O non-determinism?
Signup and view all the answers
How can multiple processes/threads be used to handle concurrency and I/O non-determinism?
How can multiple processes/threads be used to handle concurrency and I/O non-determinism?
Signup and view all the answers
What type of functions can be used to check multiple input sources at the same time?
What type of functions can be used to check multiple input sources at the same time?
Signup and view all the answers
What is the purpose of the fcntl() system call in nonblocking I/O?
What is the purpose of the fcntl() system call in nonblocking I/O?
Signup and view all the answers