Announcements
- Important Dates
- Final Assignment 8 Due Thursday at 11:59pm
- If you turn it in on Thursday, your score is multipled by 1.08.
- If you turn it in by Friday night, then there's no penalty, but there's no bonus either.
- If you turn it in by Saturday night, then your grade is capped at a 90%.
- You can't turn Assignment 8 in after Saturday at 11:59pm.
- Final Exam is Wednesday, December 13th at 3:30pm in being held in two locations
- The first letter of your last name determines where you should take the exam:
- Last names beginning with A, B, C, ...., or K: Skilling Auditorium
- Last names beginning with L, M, N, ...., or Z: Gates B01
- Will cover all material taught in Lectures 1 through 18 (through my systems principles lecture) in depth, and will expect surface understanding of the nonblocking I/O material I started last Wednesday and taught this past Monday and today.
- Exam is closed notes, closed book, closed computer, but you can bring and refer to two 8.5" x 11" sheets of paper with as much as you can cram onto their four sides, front and back.
Announcements
- Today's Lecture
- Nonblocking I/O and event-driven programming (epoll, kqueue, and libev/libuv packages), cross-language compilation, the Tornado web server, node.js and Google's V8 engine.
- Discuss the epoll suite of functions: epoll_create, epoll_ctl, and epoll_wait.
- Discuss the difference between edge-triggered and level-triggered events.
- Implement an event-driven HTML server using nonblocking I/O in one process and one thread of execution that makes efficent use of the CPU.
I/O-Event Driven Programming
- Introducing the epoll I/O notification utilities!
- epoll is a package of Linux routines that help nonblocking servers yield the processor until it knows there's work to be done with one or more of the open client connections.
- There are three functions in the epoll suite that I'll briefly introduce in lecture, if not today, then on Wednesday.
- epoll_create, which creates something called a watch set, which itself is a set of file descriptors which we'd like to monitor. The return value is itself a file descriptor used to identify a watch set. Because it's a file descriptor, watch sets can contain other watch sets. #deep
- epoll_ctl is a control function that allows us to add descriptors to a watch set, remove descriptors from a watch set, and reconfigure file descriptors already in the watch set.
- epoll_wait waits for I/O events, blocking the calling thread until one or more events are detected.
- The example I'll work with in class is too large to put in the slide deck, so you should refer to an online copy. I'll run the new server in class, explain what it does, and cover key parts of the overall design and how it uses the epoll suite to efficiently operate as a nonblocking web server capable of managing tens of thousands of open connections at once.