준비한 것이 많은 것 같던데 발표하다 시간이 늦어져서 많이 스킵해서 아쉬웠다. 발표자료라도 봐야 할 듯? 재밌었음. aio 파이썬에서 쓰는 얘기 같은 거 좀 더 보고 싶은데.
(Under Linux)
(Usual) Buffered I/O
- There are three buffers; one in user space, and two buffers (read/write) in Kernel
- Lots of copying around. -.-
Blocked I/Os
Non-blocking I/O == styll synchronous!!
- Still sequential
- It's a property of the FD
- returns EWOULDBLOCK or # of available bytes
- when asked, kernel will get the data, but that's all
- You have to poll the data out of kernel's buffer: read() again
- and this is ugly
I/O Multiplexing
- poll()
Event Driven I/O
- The readiness of an FD for I/O is refered as an event
- Libraries and frameworks
- A (possibly) thin layer around I/O multiplexing?
- Still everything is synchronous: once kernel's buffers fill up, there's no I/O happenning until you read() or write() it
- So if the handler:
- page faults
- blocks on mutex
- goes compute bound
- => we're hosed
- Why better? => far less memory, less context switching, do a lot of I/O without threads -- without GIL
- libev, pyev
- libevent
- Non-blocking Frameworks
- Tornado, Twisted, Asyncore
- So we don't really have asynchronous I/O in Linux?
- Windows has IOCP
- aio_read aio_write in Linux: examples in Python plz orz
- differences in poll/epoll
- poll: give list every time
- epoll: we don't want to give a list of 10000 fds; register once, get events triggered
- eventlet?



어떻게 보면 폰 노이만 아키텍처에서는 뭘 해도 synchronous 아닌가? 쪼개기 나름이지. 그니까 프레임워크를 쓰면 ugly 한 부분을 감춰주고 BIO, NBIO, AIO 사이에서 투명하게 전환시켜 줄 수 있어서 좋음~ㅋ