A single thread is capable of running singular commands. When multiple threads exists, multiple commands are able to be executed independently. The availability of multithreads allows for faster execution times. However, we need to be careful when handling multithreads as they are prone to race conditions which can be a consequence of inaccurate synchronisation
This exists so that multithreads can be organised safely. The mutex is used for synchronisation of threads. For example, if two threads share the same resource, the mutex has a lock and unlock function that protects the system from errors that are caused by multiple threads trying to access a shared resource at once.
Semaphores acts as a controller to the shared resource, it limits the number of threads accessing the shared resource
Each thread can be set to identify and wait for specific signals. Signals that are set will trigger the signal flag of the intended thread.