Multithreading issues and counter measures

Race condition — A race condition happens when two or more threads access a shared data and change it’s value at the same time.

When task 5 is excuting then other task will not be executed at that time frame.
Barrier flag example.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store