CS 3733 Operating Systems, Fall 2005 Assignment 3 Comments
- This assignment was graded on the basis of 30 points.
- When doing timing, keep the overhead of the timing loop as small
as possible. Move library calls such as atoi out of the timing loop
if possible.
- The server should not call gettimeofday inside the loop
in which it processes requests.
- The delay loop (calls to drand48) should be inside of
processline.
- The delay loop should be before the response is sent back to the client.
- What does the server do if it gets a line that is too long for it to
handle? For the pipe server, there is not a convenient way to handle this.
- In the parallel server, make sure the child process always terminates
and does not go back to the start of the loop and read another line.
- Avoid the following:
if (childpid = fork() > 0)
This is the same as:
if (childpid = (fork()>0))
- You should have found that the serial and parallel servers performed
almost the same. This is because the server is CPU bound so using
a child does not allow any overlap of operations unless you have multiple
CPUs. On a single CPU system, the parallel server may do better than the
serial server if it has to compete with other processes for the CPU.
- You would expect the parallel server to do better than the serial server
if you have multiple CPUs or the server was doing some I/O in addition
to the CPU calculations.