Previous | Next --- Slide 8 of 60
Back to Lecture Thumbnails
RomanArena

In the slides, it says that "Upon return, all instances have completed". So there may be some code like "pthread_join" to wait for all instances to finish?

sreevisp

I think it means that you specifically don't need to write pthread_join or something analogous since the ISPC call only returns after all instances have finished.

dyzz

@RomanArena, yes from what I understand this is the extent of the code. We are not explicitly using pthreads since we are actually using the ISPC compiler(?). Which will, in our case, end up compiling our parallel code into SIMD instructions.

kayvonf

Careful here! As @dyzz says, there are no pthreads in this program. It is an ISPC program. This slide is about the semantics of the ISPC program. ISPC states that calling an ISPC function creates programCount number of ISPC instances that each run the ISPC program in SPMD fashion. Control returns to the caller when all instances have completed.

Nowhere in this definition is any statement about pthreads, or operations such as pthread_create or pthread_join that are operations involving pthreads. If you are thinking about pthreads on this slide you have indeed made the mistake of conflating the semantics of ISPC's abstractions with a possible implementation. And the ISPC gang concept is definitely not implemented using pthreads.