Each thread executes:
my_char_array[i] = 1;
my_char_array is shared. Char i is private to each thread. However, the value of i may be the same for two or more threads.
No reading is performed. Reading of my_char_array will be done after all threads are finished.
Should I worry and place a mutex lock?
In other words, would it a problem if two threads try to execute say
my_char_array[5]=1
would result in a value different than 1 being set.
my_char_array[i] = 1;
my_char_array is shared. Char i is private to each thread. However, the value of i may be the same for two or more threads.
No reading is performed. Reading of my_char_array will be done after all threads are finished.
Should I worry and place a mutex lock?
In other words, would it a problem if two threads try to execute say
my_char_array[5]=1
would result in a value different than 1 being set.
Comment