Thread Library
This thread library is a kernel library on Unix written in C++. This library uses timer interrupts, atomicity, and a FIFO scheduling order. It can be initialized with multiple CPUs.
My partner and I were responsible for implementing the following functionality for the following objects:
CPU:
Constructor, destructor
Thread:
Constructor, destructor
void join()
: waits for the thread to finishvoid yield()
: yields the CPU to the next thread
Mutex:
Constructor, destructor
void lock()
: locks the mutexvoid unlock()
: unlocks the mutex
Condition Variable:
Constructor, destructor
void wait(mutex &)
: waits on a condition variable with the associated mutexvoid signal()
: wakes up one thread associated with the condition variablevoid broadcast()
: akes up all threads associated with the condition variable
This project was completed for my operating systems class and is stored in a private GitHub. If you would like to see the code for this project, please contact me.
Last updated