Is it safe to for example do:
void AddTwo(int &num) { num +=2; } void ThreadProc(lpvoid arg) { AddTwo((int)arg); }
Would it be saf
There is nothing wrong in calling same function from different threads. If you want to ensure that your variables are consistent it is advisable to provide thread synchronization mechanisms to prevent crashes, racearound conditions.