How to define local static variables (that keeps its value between function calls) that are not shared among different threads?
I am looking for an answer both in C
You can also use the C++11 thread local storage additions if you have access to C++11.