5570: Advanced Unix Programming

Finals -- review

Note:

You are responsible for learning material from the reading assignments, class notes, examples, and programming assignments. I give below some important topics to which you should pay particular attention. I have also listed some questions in here. That does not mean that these questions will appear directly in the exam. You need to understand the issues addressed by these questions, and be prepared to apply this understanding in different situations too. Of course, not all the topics mentioned below may appear in the exam, and there may be questions from topics not mentioned below.

It is particularly important for the finals that you show deeper understanding of the material you have learned.

UDP reliability (UNP sections 20.4 and 20.5)

  1. Understand methods to ensure flow control and error control, use of handshake, time-outs + re-transmits, sequence numbers, etc.

  2. What are two methods we used to impose flow control?

  3. What was the problem with the handshake example discussed in class?

  4. How did we solve the above problem?

  5. What problem did the above solution cause?

  6. How did we solve that problem?

  7. What were two problems with the final example codes, which I wanted you to fix?

  8. What are the mechanisms used in PAR?

  9. What are some disadvantages of PAR?

  10. When might you use UDP in preference to TCP?

  11. Why did we not implement PAR in our TCP clients/servers? Why do we need to implement it with UDP clients/servers?
Unix domain protocols (UNP chapter 14)

  1. When would you use Unix domain protocols?

  2. Why do we need Unix domain protocols?

  3. How do we address and bind a Unix domain socket?

  4. What are the semantics of connect in a Unix domain socket?

  5. Are both datagram and byte stream Unix domain protocols available?

  6. Learn to write client and servers using Unix domain sockets.

  7. What are the rules associated with the pathname for Unix domain sockets?
Threads (UNP chapter 23)

  1. Learn the use of the following pthread functions: pthread_create, pthread_join, pthread_self, pthread_detach, pthread_exit, pthread_key_create, pthread_setspecific, pthread_getspecific, pthread_once, pthread_mutex_lock, pthread_mutex_unlock, pthread_cond_wait, and pthread_cond_signal.

  2. What is the difference between a thread and a process?

  3. Which of the following are distinct for each thread, and which of the following are shared by all threads of a process: the set of instructions, program counter, stack, file descriptors, process ID, signal disposition, signal mask, thread ID, and errno?

  4. What are the different ways in which a thread can terminate, and what is the difference between the main thread and other threads in this regard?

  5. Which pthread function is analogous to each of the following: fork, waitpid, exit, and getpid?

  6. How do you avoid maintaining resources for an unjoined, terminated thread?

  7. Does thread termination close file descriptors?

  8. Why does our threaded server not handle SIGCHILD?

  9. Why does the child not close the listening socket, and the parent the accepted socket, in our threaded server?

  10. Learn about mutual exclusion.

  11. If a signal is delivered to a thread waiting for a mutex, does it resume waiting for the mutex after returning from the signal handler?

  12. Learn about thread specific data and why we need it.

  13. Learn about the use of conditional variables.

  14. Learn about the interaction of signals with threads. You will need to refer to the class notes too, and not just to the discussion in the text.

  15. From whom is the signal mask of a thread inherited?

  16. Is the signal mask shared?

  17. Is the signal disposition shared?

  18. Are signal handlers shared?

  19. Can a thread ignore signals while others don't?

  20. Can a thread block a signal, while others don't?

  21. If we type CNTRL-C, is the signal generated for the process, or for the main thread?

  22. If a thread's execution causes a floating point exception, will a generated signal be for that thread, or for the entire process?

  23. If a signal is generated for a process, to whom is the signal delivered?
Please be prepared for questions related to HW4 too.
Look at the example programs.
Review quiz questions, and other issues I mentioned in class as important.
Learn the syntax and the semantics of system calls used in the examples, and those mentioned in this review.

Last modified: 5 Dec 2002