I have a question regarding synchronization of code that is executed by several threads:
As far as I know each thread has its own stack, hence, non-static variables
Stack yes (think of a call stack, local variables), but class variables live in the heap and you have to synchronize access to them:)