Skip to content

hrutik016/POSIX-Multithreading-C-CPP-Linux

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

50 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

POSIX-Multithreading-C-CPP-Linux

This repository demonstrates a wide range of POSIX multithreading concepts through hands-on examples in C and C++ on Linux systems. It's structured into two partsβ€”Foundations (Part A) and Advanced Concepts (Part B)β€”to help you gain a solid and practical understanding of multithreading.

πŸ’‘ This repository was built while following a comprehensive Udemy course on Multithreading. If you're interested, you can check out the course here.


πŸ“‚ Repository Structure

πŸ”Ή Part A – Foundations of Multithreading

This section introduces core concepts and provides simple, practical programs to get started.

Key Topics:

  • Thread Management
    Creating threads, terminating them, managing thread stack memory, and understanding thread scheduling.

  • Concurrency vs Parallelism
    Differences between singularism, concurrency, and parallelism with real-world analogies.

  • Joinable vs Detached Threads
    Implementation and use cases with practical examples like a map-reduce model.

  • Inter-Thread Communication (ITC)
    Concepts such as callbacks, notification chains, and publisher-subscriber models.

  • Thread Synchronization
    Managing shared resources using mutexes, condition variables, and critical sections.

  • Classic Synchronization Problems
    Solutions for standard problems like:

    • Producer-Consumer
    • Dining Philosophers
  • Semaphores
    Basics, usage, and how they differ from mutexes.

πŸ“ All examples are available in the Part-A/ directory.


πŸ”Έ Part B – Advanced Multithreading Concepts

Take your skills further with in-depth explorations and custom implementations.

Topics Covered:

  • Recursive Mutexes
    When and how to use them.

  • Read-Write Locks
    Advantages and custom implementation.

  • Monitors
    Using monitors to structure thread-safe operations.

  • Assembly Line Pattern
    Designing concurrent workflows for real-world applications.

  • Deadlock Detection and Prevention
    Techniques to identify and avoid deadlocks.

  • Wait Queues & Thread Pools
    Efficient multithreading task management patterns.

  • Bonus Concepts
    Including:

    • Bounded Waiting
    • Strong Semaphores
    • Event Pair Synchronization

πŸ“ These examples can be found in the Part-B/ directory.


πŸ™Œ Thank You for Visiting!

If this project helped you understand POSIX multithreading better, consider ⭐ starring the repo to support the work!

πŸŽ“ Ready to go deeper? Explore the accompanying Udemy course here.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages