Introducing

Thread Safe RBTree

C++

This was the most challenging and fun assignment I have had in C++. Because we were graded based on the performance and accuracy of the system we had to make sure the multi-threads of reads and writes to the red-black tree were working properly. This was my first serious project that had to involve semaphores.


The majority of the red-black tree algorithm was referenced from GeeksForGeeksInsert and GeeksForGeeksDelete. For the mutual exclusion, I decided to use 2 semaphores, one for reading and one for writing. The program ended up working well, with an error that would rarely occur if hundreds of semaphores were initiated with only a few actions that needed to be done.
Overall this was a really fun project to work on, and it was fun to spend some time in the C++ world!