Previous | Next --- Slide 27 of 65
Back to Lecture Thumbnails
anonymoose

In case 2 (the second example), it seems like the compiler should be able to figure out that we're still effectively in case 1, since nothing happens between the last cilk_spawn and cilk_sync. From a readability standpoint, it seems much more clear to me that all independent methods get a "cilk_spawn" before them; in other words, case 2 seems like the more readable version of case 1. So, would it be possible and worth implementing that optimization in the compiler so that case 2 actually compiles the same as case 1?