threadsafe tmps