SGG 4 (02)

We skipped some sections of the chapter and added some other contents.

4.1 Overview

  • What are threads?
  • Benefits of threads.
  • Relation between threads and processes.

4.2 Multicore programming

We will discuss this topic in Wednesday (9/18)

  • What is multicore programm?
  • Five challenges for multiprogramming.
  • Types of parallelism: Data parallelism and task parallelism
  • Multicore programming library: OpenMP
  • General structure of OpenMP programs, how OpenMP programs share data.

4.4 Thread libraries

We discussed extensively the pthread library.

  • Overall pthread programming model, thread creation, calling the worker function, thread termination, and thread join.
  • How is the function thread_create() called? What are the parameters? How are they set up?
  • How to initialize and access thread attributes?
  • How to pass parameter(s) to a worker function in general? What if a thread worker function requires a single parameter? What if multiple parameters are required? How to pass the result of computation in a worker function back to the calling function?
  • Though we will discuss the thread communication and synchronization extensively in next chapter, students should be aware of the potential issues such as race condition when multiple threads share common data.
Print Friendly