Okay, i have this question in one regarding threads.
there are two unsynchronized threads running simultaneously and using a global resource \"int num\" 1st:
As Thomas said, the results are unpredictable because your increment and decrement are non-atomic. You can use InterlockedIncrement and InterlockedDecrement -- which are atomic -- to see a predictable result.