Question about optimal thread allocation for vector of problems of differing sizes

FYI with Transducers.jl it’s reduce(right, Map(do_problem), v; basesize=1) where basesize=1 means to process one item per thread (see Thread- and process-based parallelisms in Transducers.jl (+ some news))

It’s better to wrap it with @sync, as in @sync for i in 1:16; Threads.@spawn ... so that the next code is run only after all the tasks are finished.

2 Likes