Multithreading and a bit about caching