You can’t use an array indexed by threadid()
, but there are other mechanisms for task-local storage.
For example, the Base
function task_local_storage()
gives you a task-local IdDict
. You can also use other patterns, e.g. a Channel
as described in Pattern for managing thread local storage? - #2 by tkf.