Skip to end of metadata
Go to start of metadata

Although my C code runs just fine as well, I decided to change things to reflect C++11 threading changes.

Here are snapshots of the way I changed the method and how I call the threads:


The picture above is the function definition. I no longer return void*, but just void, which is good enough for C++11. I added all of the info previously stored in structs as parameters, getting rid of the need to have thread info structs.


The picture here shows the new syntax for creating/running and joining threads, as explained in task 1.

As for results, the trend of sequential being faster overall and more threads being slower continues, but this is because we are using qsort. Interestingly enough, this program gets slightly faster times on average compared to the C equivalent.

 

Labels
  • No labels