Previous | Next --- Slide 31 of 64
Back to Lecture Thumbnails
harlenVII

What's the advantage of lazy initialization? Will it introduce more latency than initialize all threads in the beginning?

kapalani

@harlenVII For a machine with a large number of cores that's running a program that never calls Cilk_spawn, it is unnecessary to incur the cost of spawning a large number of threads, which is why the lazy initialization helps. The cost of having to spawn the threads is something that cannot be hidden if the program uses Cilk_spawn, but in case the program doesn't it can be avoided