Right now we have an array of these, one per thread. This may no longer be safe since tasks can now migrate between threads. Would be better to have this per task?