Previous | Next --- Slide 40 of 62
Back to Lecture Thumbnails
apappu

Here -- I wasn't sure if this was stated so wanted to ask: Is continuation stealing a better implementation choice than child stealing so that we don't end up spawning a bunch of child tasks that we don't have threads to execute (as in the for loop example)?

zmelnyk

It seems that way to me since we would only need to store the context for one thread/continuation rather than a ton of new contexts that are nearly identical for each new child spawned.

amohamdy

This was counter-intuitive for me. My first thought was that there might some extra cost associated with changing the context of the calling thread to run a different function, but I assume it's very insignificant. Zmelnyk's explanation makes a lot of sense though.

Please log in to leave a comment.