Multithreading with seperate caches for each thread?

An example of the same idea but without macros can be seen here: PSA: Thread-local state is no longer recommended; Common misconceptions about threadid() and nthreads() - #26 by Mason