Skip to content
Linux Programming
Threads

Threading: Parallelism and Concurrency

Topic Outline

Overview of Memory Layout: Heap and Stack

  • Understanding the memory layout of a process, including the heap and stack.
  • Explaining the concept of the call stack and its role in thread execution.

The Concept of Thread and Thread Context

  • Introducing the concept of a thread and its execution context.
  • Highlighting the main differences between a process and a thread in terms of isolation, memory management, and scheduling.

Understanding Parallelism and Concurrency

  • Explaining the difference between parallel and concurrent execution.
  • Understanding how threads enable concurrent execution within a single process.

Introduction to Pthread Library

  • Overview of the Pthread library (POSIX threads) for thread programmability.
  • Covering essential functions for creating, joining, and cancelling threads using the Pthread API.

References

Practice

Writing Multi-threaded Programs using Pthread Library

  • Hands-on exercises to write multi-threaded programs using the Pthread library.
  • Implementing parallel execution of tasks within a single process using threads.

Using Library Functions to Manage Threads

  • Practical demonstrations of using library functions to join and cancel threads within a program.
  • Understanding the role of thread synchronization and coordination.

Compilation and Linking with Pthread Library

  • Understanding the compilation and linking process with the Pthread library.
  • Ensuring proper integration of Pthread library functions in multi-threaded programs.

References

Homework

Samples