Race-condition

| Page Views: 45

C# Threading - Race Condition

Implementing Threads in applications is not an ardous task.

Tasks can divided implemented in independent threads and the threads can be scaled along with the number of CPU cores.

The problem comes when those threads need to interact with each other. And this is something which is more common in real world projects than you would imagine.

When they require exchanging some information. This requires allocation of space in RAM that is accessible to both threads.

And this is the root of many of the much talked about problems in parallel programming.

The first and one of the biggest of these is called race condition. This comes due to undefined access order. We can get incorrect results from calculations due because multiple threads can access and read or write the shared variables in an unpredictable order.

How do You Feel after reading this?

According to scientists, we humans have 8 primary innate emotions: joy, acceptance, fear, surprise, sadness, disgust, anger, and anticipation. Feel free to tell us how you feel about this article using these emotes or via the comment section.

About Me.

After completing his Software Engineering bachelors program, Oclemy(Clement Ochieng) these days is a man of two lives. At day he works for a startup in Nairobi, Kenya. At night he works tirelessly on building ProgrammingWizards TV, a tv channel for student coders and this website to help share the source code. In between he practices Meditation and Self actualization to help him keep balance. He also likes going for long solo walks to connect more with nature.




Recommendations


What do You Think


Previous Post Next Post