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)
-
- Understand methods to ensure flow control and error control,
use of handshake, time-outs + re-transmits, sequence numbers, etc.
- What are two methods we used to impose flow control?
- What was the problem with the handshake example discussed in class?
- How did we solve the above problem?
- What problem did the above solution cause?
- How did we solve that problem?
- What were two problems with the final example codes, which I wanted you to fix?
- What are the mechanisms used in PAR?
- What are some disadvantages of PAR?
- When might you use UDP in preference to TCP?
- 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)
-
- When would you use Unix domain protocols?
- Why do we need Unix domain protocols?
- How do we address and bind a Unix domain socket?
- What are the semantics of connect in a Unix domain socket?
- Are both datagram and byte stream Unix domain protocols available?
- Learn to write client and servers using Unix domain sockets.
- What are the rules associated with the pathname for
Unix domain sockets?
- Threads (UNP chapter 23)
-
- 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.
- What is the difference between a thread and a process?
- 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
?
- 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?
- Which pthread function is analogous to each of the following:
fork, waitpid, exit,
and getpid
?
- How do you avoid maintaining resources for an unjoined, terminated thread?
- Does thread termination close file descriptors?
- Why does our threaded server not handle SIGCHILD?
- Why does the child not close the listening socket, and the parent
the accepted socket, in our threaded server?
- Learn about mutual exclusion.
- 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?
- Learn about thread specific data and why we need it.
- Learn about the use of conditional variables.
- 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.
- From whom is the signal mask of a thread inherited?
- Is the signal mask shared?
- Is the signal disposition shared?
- Are signal handlers shared?
- Can a thread ignore signals while others don't?
- Can a thread block a signal, while others don't?
- If we type CNTRL-C, is the signal generated for the process, or for the main thread?
- If a thread's execution causes a floating point exception, will a
generated signal be for that thread, or for the entire process?
- 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