Community
cancel
Showing results for 
Search instead for 
Did you mean: 
dan_x_
Beginner
24 Views

how workers migrate between the arenas?

hi all, the following words is from Andrey Marochko 's blog:

"It is also important to realize, that there will always be some timeout between the moment the market updates worker quotas, and the moment when workers actually migrate between arenas. This happens because a worker can discover that it needs to leave its current arena in order to join another one only when it is both in its stealing loop (that is does not have tasks in its local task pool) and does not execute a nested parallel algorithm. Thus re-establishing fairness of worker threads distribution may take a noticeable time in some cases."

Obviously, "updates worker quotas" and "workers actually migrate between arenas" are different things; in the source code, I found that "updates worker quotas" was done by function "update_allotment", which was maily called by ‘is_out_of_work’ and ‘advertise_new_work’. But I don't find the place where "workers actually migrate between arenas" in the source code, so how did that happen?

BR,

Xiaoqiang

 

0 Kudos
2 Replies
RafSchietekat
Black Belt
24 Views

At first sight, receive_or_steal_task() will exit with NULL, then local_wait_for_all() exits, then arena::process(), and then market::process() finds a new arena where the thread can do useful work. But don't hold me to that.

dan_x_
Beginner
24 Views

Raf Schietekat wrote:

At first sight, receive_or_steal_task() will exit with NULL, then local_wait_for_all() exits, then arena::process(), and then market::process() finds a new arena where the thread can do useful work. But don't hold me to that.

Thanks Raf, yes, you are right. I found a while-loop in market::process to switch arenas.

Reply