Question: are static variables shared between threads?
Answer: Static variables are indeed shared between threads, but the changes made in one thread may not be visible to another thread immediately, making it seem like there are two copies of the variable. ... Memory writes that happen in one thread can "leak through" and be seen by another thread, but this is by no means guaranteed.