Day 20/100 100 Days of Code
Learning

AKA Chris, is a software developer from Athens, Greece. He started programming with basic when he was very young. He lost interest in programming during school years but after an unsuccessful career in audio, he decided focus on what he really loves which is technology.
He loves working with older languages like C and wants to start programming electronics and microcontrollers because he wants to get into embedded systems programming.
I spent the session watching more tutorials on concurrency. I watched the whole playlist and I learned how both Mutex and BinarySemaphore can be used and where to use them. I learned about the std::jthread object which can be used to automate the join operation and the std::jthread::request_stop to stop any running threads.
What is the difference between Mutex and Semaphore
Allows only one thread to go through a critical section
A section is locked or unlocked
It pretty much is a locking mechanism
Semaphore
Multiple threads can be used at the same time
It depends on the counter
It is a signaling mechanism
When to use Mutex and when to use Semaphore
To run a single operation on multiple threads, use Mutex. To run multiple operations at the same time synchronized, use Semaphore as signaling can be used to make a thread start doing its operation or wait for a signal to start.




