SPRUI04F july 2015 – april 2023
Thread safety involves creation, initialization, maintenance, and destruction of thread-private data. It also requires that accesses to data that is shared between threads must be protected. That is, only one thread should be allowed to access a piece of shared data at a given time. An additional issue that needs to be addressed on multi-core devices that have a private data cache (L1D cache on C6600 devices, for example) is that copies of shared data that exist among private data caches and shared memory must be kept coherent. This means that if a thread reads a piece of shared data into the private data cache on a processor, it must invalidate any local copies of that data that exist in the local data cache before accessing or modifying the data. This ensures that the currently executing thread will only access the latest available copy of the shared data.