I\'m implementing Inter-Thread Communication using global variable.
//global var
volatile bool is_true = true;
//thread 1
void thread_1()
{
while(1){
The thread safeness of this piece of code does not depend on atomicity of the assignment. Both thread routines work strictly in turn. There is no race condition: thread_1 will output stuff until getting certain random number after which it will leave the 'output section' and let the other thread work in it. There are a couple of things worth noting though: