How to process a dictionary with multi tasking?

Then you could do:

ks = collect(keys(d))

Threads.@threads for k in ks
    v=d[k]
...

To be clear, the other suggestions with packages probably have nice conveniences, but if you want to avoid a dependency, I think this should work even if it costs you an allocation.

1 Like