Week10-Select - Haviland 7.1.6 1 The problem c1! gone for...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Haviland 7.1.6
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 The problem c1 server c2 read(c1) read(c2) write “gone for coffee” blocked When reading from multiple sources, blocking on one of the sources could be bad. An example of denial of service. One solution: one process for every client. What are the pros and cons of this solution?
Background image of page 2
3 Another way to look at the problem Which of the system calls might block indefinitely? read and accept So what happens if there is only one connection? Server while(1) accept a new connection for each existing connection read write
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 Blocking I/O Model application kernel read no data ready data ready copy data copy complete process data wait for data copy data from kernel to user process blocks in a call to read system call return OK
Background image of page 4
5 Nonblocking I/O Model application kernel no data ready data ready copy data copy complete process data wait for data copy data from kernel to user process repeatedly calls read waiting for an OK ( polling ) return OK read system call EWOULDBLOCK read system call EWOULDBLOCK read system call
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Signal Driven I/O Model application kernel no data ready data ready copy data copy complete process data wait for data copy data from kernel to user process continues executing return OK establish SIGIO handler sigaction return read system call signal handler deliver SIGIO process blocks
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 08/02/2011.

Page1 / 17

Week10-Select - Haviland 7.1.6 1 The problem c1! gone for...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online