Quantcast
Channel: First steps - JuliaLang
Viewing all articles
Browse latest Browse all 2795

Multithreaded task spreading

$
0
0

@tro3 wrote:

Apologies for the simple question. If I keep the number of active Threads.@spawn tasks <= numthreads, will I keep to a more-or-less one task per thread distribution?

I am working on a TaskPool that manages incoming tasks, placing them across multiple threads as previous tasks finish. (In my use case, 1% of the Tasks take 99% of the time, so the default distribution of the Threads.@threads macro doesn’t really cover me, and I’ll eventually need to extend to stack processing anyway.) I’d like to limit the tasks to one per thread (perhaps this is debatable), but there is no Threads.spawnat macro, and the Task scheduler refers only to a cryptic (to me) “multiq”. Specifically, it says

# if multiq is full, give to a random thread (TODO fix).

This is the only thread distribution info I can find - it descends into C after that. Hence the question above.

I’m happy to help in this area if needed, BTW.

Posts: 7

Participants: 4

Read full topic


Viewing all articles
Browse latest Browse all 2795

Latest Images

Trending Articles



Latest Images