Skip to end of metadata
Go to start of metadata

For this task, too, I didn't need to modify much. The main change I made was, again, deleting the struct and passing the parameters directly into the function called by the thread, made possible by C++11 threads. I used the same ppmIO file, I just had to compile differently to make the cpp files work with C code.


The picture above is another part I changed. Whereas before, I had a list of all thread info structs and a list of all threads that I made in a loop, I made and ran all of the threads in the same loop this time, which was much more efficient and readable.
As before, the speed was, on average, slightly higher than the C version, and more threads took longer. But this time, the results for using 1 and 2 threads were slightly faster than the sequential time, if only by chance.

Special thanks to Tatsuya for compilation help

Labels
  • No labels