Course Computer Systems - A programmer's perspective


This is the information for 2012. The previous information can be found at 2011 page.


Today a computer system is not longer alone, but part of a large community: the internet. A typical interactive program is not longer waiting on the input of a single user on a local machine (as for instance a shell), but a server that can handle requests from clients all over the world. We will see that the internet protocol is based on the concepts of sockets. Sockets are full-duplex I/O streams, and can be handled in quite the same way as other I/O streams (as for instance files) as soon as they are properly initialised (opened). Yet, the initialisation phase of sockets is quite unique, because this phase is designed to facilitate the client-server model. First we will show a very simple web-server that is able to handle the request of one client at the time. Then we will demonstrate how we can scale such a server up to handle multiple clients. This is possible in three different ways:

  • processes: every client gets its own (child) process, with its own process flow, and its own virtual memory space.
  • I/O multiplexing: in a single process different functions are called depending on the events on multiple I/O channels.
  • threads: a hybrid of the other two approaches, where a thread has its own process flow, but shares the virtual memory space.

In this class the following concepts are introduced:

  • ports, sockets
  • I/O functions: standard, raw, robust
  • concurrent processes, I/O multiplexing, threads


The class is based on chapters 10, 11 and 12 of the book Computer Systems: A programmer's perspective by R.E. Bryant and D.R. O'Hallaron.

Recommanded reading (46 pages, 2.5 hours):

11.3.3Internet Connections
11.4 The Socket Interface
11.5 Web Servers
11.6 Putting it Together: The Tiny Web Server
10.8 Standard I/O
10.9 Putting it Together: Which I/O Functions should I Use?
12.1 Concurrent Programming with Processes
12.2 Concurrent Programming with I/O Multiplexing
12.3 Concurrent Programming with Threads
12.4 Shared Variables in Threaded Programs


The class is scheduled in three hours:

  1. Lecture: 'Computer system - An iterative Web server'
    Assignment: Problem 12.10 Add a form to the CGI adder function.
  2. Lecture: 'Computer system - A concurrent Web server'
  3. Lecture: 'Computer system - the applicability to an Aibo'
  4. Exercise: 'Build a http-proxy'
    Description, code, Makefile with handin2013.

Last updated October 16, 2013

o This web-page and the list of participants to this course is maintained by Arnoud Visser (
Faculty of Science
University of Amsterdam

visitors in