Skip to the content.

← Back to Home


C++ Thread Library: Cooperative Threads & Monitors

View Code on GitHub February 2025


Overview

This project implements a custom C++ Thread Library that simulates cooperative multithreading and synchronization primitives such as mutexes and condition variables. It demonstrates how operating systems manage context switching, thread lifetimes, and interrupt handling.


Features


Key Components:

Component Functionality
cpu class Bootstraps CPUs, sets up interrupt handlers, manages thread execution, and handles CPU suspension.
thread class Manages thread creation, voluntary yielding, joining, and context switching.
mutex & cv classes Provides mutual exclusion and thread synchronization mechanisms (FIFO order).
ucontext API Low-level context switching primitives (makecontext, swapcontext, setcontext).

Technologies


Access


← Back to Home