RATE THIS ANSWER
0
Click to Vote:
0
0
Last Answered:
Jun 14 2008 6:47 AM GMT
by BobBeechey
The simple answer is chaos MIGHT ensue. Consider, only one copy of the data item exists. Suppse thread1 reads to inspect the variable and update it. Before writing the new copy, thread2 has written a changed value. Worse, if the data member is an array and thread1 is sorting it while thread2 is updating part of it ...
Synchronisation (thread harmonisation) constructs are essential. With regard to this, older C-style constricts such as strtok() use static fata beneath the covers and are thus not thread-safe.