Previous | Next --- Slide 19 of 62
Back to Lecture Thumbnails
shivalgo

There will. be communication latency when pulling from another queue especially if it is distributed over multiple computers?

tmdalsl

When other threads are stealing work from the work queue of different threads, how do thief threads know whether a work they have to steal is the heaviest task? Because, in order to perform smarter work distribution among the threads, we need free threads to handle heavier tasks, right? Or does the stealing-from-work-queue format disregard that case completely and just care about taking what's the frontmost work in the queue?

pranil

@tmdalsl, you're right, I was wondering about the same thing. I've convinced myself that the thief threads will always steal the oldest task in the busy thread's work queue. This is good because in most recursive algorithms, the oldest task in the work queue will be the largest; these algorithms always start with larger chunks of work and work towards the smallest "base" case via recursion.

More importantly, the intent behind the design is that while thief threads should steal the oldest task, each individual thread should steal the newest task from its work queue whenever it becomes idle. For each individual thread, this gives benefits in terms of data locality.

Please log in to leave a comment.