Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

time execution of multithreaded process runing on a multiprocessor system

so i have this question concerning multithreaded processes running on multiprocessors.
my machine has 8 logical processors (4 physical cores and 2 threads per core).
i run a process each time with different number of threads (work of process is distributed on those threads created), and i displayed time for the process to complete execution along with time information displayed by "time command" in Linux.

now the time of execution of the process was decreasing as i increase numbers of threads, which is logical since the work is being divided on the threads and these threads benefit of parallelism. based on what i understand when number of threads> number of processors ie number of threads is 16 for example, the time it takes the process to execute should increase. BUT my results were :

for number of threads = 8 , the time for process execution was 592ms :
enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

and for number of threads=16, the time of process execution was 594ms:
enter image description here

my question is : i only see an increase of 2ms, why it didn’t highly increase since we literally have number of threads in the process double the number of processors

>Solution :

You have a ditch to dig, but you only have 8 shovels. Does it matter much if there are 8 spare workers on coffee-break? Sure, a little time might be lost after the break when the shovels are handed over to the rested diggers but, overall, it’s not going to make much difference to how long it takes to finish the ditch.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading