Classic Synchronization Problems
📄️ Producer-Consumer
The problem involves two threads
📄️ The Dining Philosophers Problem
The problem refers to multiple philosophers (threads) seated at a circular table. On the table, there are 5 plates and 5 forks, so each philosopher has one fork to the left and one to the right. While sitting at the table, philosophers can perform two actions: eat or think. To eat, a philosopher needs two forks (which they can only use if they are not taken by their neighbors).
📄️ The Barber Problem
We have the following situation: a barbershop with one barber (one thread), one barber chair, N waiting chairs, and M clients (M threads).
📄️ Readers-Writers Problem
We have a shared memory area where multiple read and write actions occur. This memory area is shared by several threads, which are of two types: readers (perform read actions from the memory area) and writers (perform write actions to the memory area).