my program has 2 threads , integer global variable. assume global variable initialized value before thread2 started execution. both threads reading variable. race condition possible?
these functions executing 2 threads simultaneously , repetitively in program.
void thread1(int iparam) { if ( gi_varable == iparam ) //do } void thread2(int iparam) { if ( gi_varable == iparam) //do }
accessing , trying manipulate same data concurrently race condition.here both thread reading global variable not trying manipulate there no race condition.