CS3331 Reading List: Week 4

Course Material
Slides used in class is available in the common directory with filenames 03-Process.pdf and 04-Thread.pdf.
Study Unix Multiprocess Programming
If you wish to print these slides, print them double-sided and print as many slides as possible on the same page. Let us save a tree!
We will prove a number of important facts throughout this semester, in pareticular during this and next week. The main technique to be used is "prove by contradiction." If you have forgotten how to prove things, please be prepared to dust off and read your 2311 Discete Structures or similar textbooks. We will not review proving techniques.

Programming Material
Do Programming Assignment II.

Homework Assignment
Answer the following questions: Answers to these questions can be found in the above mentioned slides.
  • In the common directory you will find a file 03-Process.tar.gz. This file contains two programs, shm-02-server.c and shm-02-client.c. They are detailed versions of the "server" and "client" programs discussed in class. Unzip, untar and compile both. Then, run them as follows:
    1. Method 1
      • Run shm-02-server with three integers as command line argument in one window. Watch the output of this "server" program.
      • Move to a second window and run shm-02-client. What do you see? Understand and match the output lines from both programs.
    2. Method 2
      • Run both programs in the same window as follows: shm-02-server a b c & shm-02-client, where a, b and c are three integers.
      • What do you see? Understand and match the output line from both programs.
  • What is a thread or lightweight process?
  • What are the resources needed to run a thread?
  • Why are threads cheaper than processes?
  • What are the major benefits of using threads?
  • What is a user-level thread?
  • What is a kernel supported thread?
  • Describe the major advantages and disadvantages of using user-level threads and kernel supported threads.
  • What are the thread models?
  • How threads of a process are scheduled in each model?
  • Understand the six points discussed in the multicore programming section.
  • What are the two commonly used thread cancellation methods?
  • What is thread-safe? Why is it important?
  • What is a coroutine?
  • What is a fiber?
  • What is the relationship between a thread and its fibers?
  • Why is the use of fibers "cheaper" than threads?
We do not collect your practice work; but, similar problems will appear in quizzes and exams in the future. Note that I will not make any announcement in class for these short quizzes. In other word, short quizzes may take place at any time as long as I see it is appropriate.