Previous | Next --- Slide 11 of 64
Back to Lecture Thumbnails
haboric

I understand that worker threads pull data from shared work queue. But I am not clear why pushing new work to queue as it is created is also done by worker threads. Does it mean there are two different pools of worker threads, one working on pushing, the other one working on pulling?

fleventyfive

@haboric, I think this is more like a "feedback" loop created by the workers themselves; they pull tasks from the queue, and if required, push tasks into the same queue, so that the task may be pulled by any of the free workers. There need not be different pools of worker threads.

Lotusword

Raytrace is a good example of dynamic assignment, where the work associated with each ray is impossible to predict, and even if the rendering is repeated from different viewpoints the change in viewpoints may not be gradual.

lol

I assume simply having one queue isn't sufficient? If we have a lot of threads accessing the queue, contention serializes the accesses. We would probably want P queues where P is the number of processors and use work stealing.

Nevermind this is discussed in a later slide.