I have a variable in my function that is static, but I would like it to be static on a per thread basis.
How can I allocate the memory for my C++ class such that eac
boost::thread_specific_ptr is the best way as it portable solution.
On Linux & GCC you may use __thread modifier.
So your instance variable will look like:
static __thread MyClass *instance = new MyClass();