Chapter 7 Student Notes

Chapter 7 requires you to extend previously written programs in three interesting ways. In Experiment 7.1 and 7.2 you rewrite previously written programs to provide concurrency using threads and processes respectively. In 7.3 you build a multiservice server.

The degree of difficulty will depend heavily on your previous work in operating systems. If you are a master of forks and threads, this chapter should not be too bad. One factor that hindered me all the way through was the inability of gdb to handle threads and forks. In Experiment 7.3 my server was not handling the echo function although file transfer was fine. I got into gdb and stepped through the forkfunction. It returned values such as 5040 and 5060, that is, it seemed to return such values. In fact, with any breakpoint set, the program would never get to my echo handler, yet if you just ran the program, even in gdb, it would reach that handler. Nasty!

Note that on page 39 the suggestion that you start with an echo server is just a bit misleading. To complete the assignments in this chapter you will need both an echo server and a file server, and it is the latter that first comes into play.

The second exercise on page 40 is absolutely critical in my humble opinion. I thought that I had written this server correctly, but it failed at this point.



This site is maintained by by W. David Laverell of the Computer Science Department at Calvin College.
For assistance or corrections, please contact him at lave@calvin.edu.