In lecture we discussed how placing foo in work queue is better than putting the continuation in work queue. Why?
This comment was marked helpful 0 times.
yrkumar
@shabnam: We didn't necessarily say categorically that placing foo in the work queue is better than putting the continuation in the work queue. In fact, in the case where worker threads can "steal" work from other queues, putting the continuation into the queue might be the better strategy because then stealing would involve stealing more work (assuming that the continuation spawns off more threads). Further on in the lecture, it actually mentions that in the case where the continuation spawns off more threads and we place the continuation in the queue, there is a provable bound on the work queue storage for a system with T threads. However, one benefit of placing children in the work queue and continuing to execute the continuation is that it exposes all of the parallelism present in the program at the outset.
This comment was marked helpful 0 times.
yanzhan2
Also, as mentioned in the lecture, run child first would be a little computational easier, since there is less registers to save for caller saved registers.
In lecture we discussed how placing foo in work queue is better than putting the continuation in work queue. Why?
This comment was marked helpful 0 times.
@shabnam: We didn't necessarily say categorically that placing foo in the work queue is better than putting the continuation in the work queue. In fact, in the case where worker threads can "steal" work from other queues, putting the continuation into the queue might be the better strategy because then stealing would involve stealing more work (assuming that the continuation spawns off more threads). Further on in the lecture, it actually mentions that in the case where the continuation spawns off more threads and we place the continuation in the queue, there is a provable bound on the work queue storage for a system with T threads. However, one benefit of placing children in the work queue and continuing to execute the continuation is that it exposes all of the parallelism present in the program at the outset.
This comment was marked helpful 0 times.
Also, as mentioned in the lecture, run child first would be a little computational easier, since there is less registers to save for caller saved registers.
This comment was marked helpful 0 times.