Project 3 FAQ

This is a list of frequently asked questions about Project Three. It will be updated as questions arise, so check back here if you are having difficulty.
  1. Q: I don't get what sort of "data structure" I am supposed to use for the requests. C doesn't have abstract data types like C++.

    A: You can simply hook up all of the existing request structures into a linked list. Each request structure has a "next" pointer, and the code already contains an example of a "list_head" pointer that can point to the list head. You should use your skills from data structures to add elements to the head of the list, remove them from the middle, and so forth. Don't worry about "abstracting away" the linked list from the requests. Just make it work.

  2. Q: When using the sfirst and dfirst disciplines, it's kind of complicated to remove a request from the middle of a single-linked list.

    A: Yes, that's true. There are several ways that you can make this less complicated. One way would be to turn the singly-linked list into a doubly-linked list. That is, each request structure would have both a "previous" and "next" field. Then, removing an element from the middle is easy, but inserting elements is slightly more complicated.

    Another option would be to keep two singly linked lists, one for static content, and the other for dynamic content. Then, you only need to insert at one end and remove at the other, choosing the appropriate list for the request type and the scheduling mode.

    Finally, you could just embrace the complexity of removing items from the middle of a singly-linked list. It's mildly tricky, but not impossible. Any of these ways are acceptable, as long as the system works.

  3. Q: I can't get wwwdriver to work when the client is on one machine and the server is on another. I keep getting "Connection refused."

    Whoops, that is a bug in wwwdriver! It has been fixed, so simply download a new copy and try again.