Master Class – Multithreading & Thread Synchronization in C

Linux POSIX Threads ( Pthreads ), thread Synchronization, Operating System Concepts, C/C++ programming with Projects

Welcome to the Course Series on Multi-Threading – The Master Class Course on Threads.

What you’ll learn

  • MultiThreading Fundamentals.
  • Concurrency.
  • Mutual Exclusion Vs Atomocity.
  • Thread Synchronization Techniques.
  • Writing Thread Safe Codes.
  • Thread standard problems – Reader-Writer Problem.
  • Mutexes, Semaphores, Monitors.
  • Signaling and Wait.
  • Detecting and preventing locks.
  • Debugging multithreaded Programs.
  • Interview Questions.

Course Content

  • Getting Started With Multi-Threading –> 10 lectures • 44min.
  • Concurrency Vs Parallelism (Theory Section) –> 11 lectures • 49min.
  • Joinable and Detached Threads –> 6 lectures • 39min.
  • Inter Thread Communication –> 4 lectures • 16min.
  • Let us go on Vacations ! yaay ! –> 1 lecture • 1min.
  • Notification Chains –> 12 lectures • 1hr 5min.
  • Thread Cancellation – Asynchronous –> 10 lectures • 50min.
  • Thread Cancellation – Deferred –> 2 lectures • 12min.
  • Listener Threads –> 4 lectures • 18min.
  • Appendix A : Glue Based Linked List –> 10 lectures • 46min.

Master Class - Multithreading & Thread Synchronization in C

Requirements

  • C language is MUST.
  • Linux Operating Systems.
  • Zeal to learn and excel.
  • Enthusiasm to write lots of Code.

Welcome to the Course Series on Multi-Threading – The Master Class Course on Threads.

 

  [ ** STILL ADDING CONTENT TO IT, LAST UPDATED 02 JAN 2020 ** ]

 

This course is for those who want to develop fundamental concepts on Multi-threading and related concepts. In this course, we shall be going to cover Multi-threading concepts based on Pthreads (POSIX threads) on the Linux platform.

We shall discuss several concepts involved in multithreading and demonstrate each concept through a sample program. Several Important Concepts include but not limited to – Deadlocks, Mutual Exclusion, Atomicity, Thread Synchronization, Race Conditions, Thread forking, and many more.

In the Next Installment of this course, we shall extend our knowledge of Multi-threading to Advance Concepts which also include mini-projects on Multithreading and Thread Synchronization.

 

At each stage of this Course series, you shall be writing a lot of multi-threaded Codes. So be ready to Master the Multi-threading. Along the journey, we shall cover several interview-favorite topics and Questions to prepare you alongside for interviews.

 

Best of luck!

 

Table Of Contents:

= = = ======= = = =

1. Understanding Threads

  • Thread Creation & Termination
  • Race condition on Thread Creation
  • Passing Argument to Thread Function
  • Stack Memory Mgmt for Multi-threaded Programs
  • Thread Scheduling

2. Understanding Concurrency and Parallelism

  • Singlularism Vs Concurrency Vs Parallelism
  • Concurrent Process Design – 2 Examples
  • Threads as Light Weighted Process
  • Overlapping and Non-Overlapping Work

3. Joinable and Detached Threads

  • Joinable Vs Detached Threads
  • How to Join a thread
  • Whom to Join?
  • Sample – Map-Reduce Program

4. Inter Thread Communication

  • Understanding Callbacks and Function Pointers
  • Best way to implement ITC
  • Implementing Notification Chains
    • A Publisher Subscriber Model
    • How to Subscribe/UnSubscribe
    • How to send Notification to Subscribers

5. Asynchronous Thread Cancellation

  • Thread Cancellation
  • Asynchronous and Deferred Thread Cancellation
  • Problem with Async Thread Cancellation
    • Resource Leaking
    • Invariants
    • Deadlocks
  • Concept of Thread Cleanup Handlers
    • Prevent Resource Leaking
    • Data Structure Corruption – Invariants
    • Cancellation causing Deadlocks

6. Deferred Cancellation

  • Understanding Deferred Cancellation
  • Implementation

7. Listener Threads – Responsibility Delegation

  • Why Listener threads?
  • Designing Listener threads
  • Code Changes and Demo
  • Cancellation of blocked Threads                       << Delivered till here as on 02 Jan 2020

 

Listing Upcoming Topics ( Under Progress )

= = = = = = = = = =  = = = = = =  = = = = = =

2. Thread Pools

Then We enter into Thread Synchronization Topics :

3. Mutexes and their internal implementation

4, Condition Variables

5. Lock Size

6. Deadlocks

7. Standard Problems – Reader/Writer Problem, Dining Philosopher problem etc

8. Implementing Master-Slave Relationship between threads

9. Implementing Thread Scheduler

10. Implementing Thread Monitors

11. Semaphore based Synchronization

12. Deadlock Detection and Prevention

13. Asynchronous Programming using Threads (Say Good bye to Locking)

14. Implement Timers using Threads

15. How to fork a multi-threaded process

 

So you can see, some really amazing stuff is yet to come.

 

Depending on the content size, I may split the content into two parts – Course A & Course B. Don’t worry, whoever enrolls in part A will be given free entry in Part-B.

Happy Learning.

Get Tutorial