c++ - PC performance and stability issue in multithreaded simple benchmark. How to make each thread run on separate core? -


look @ code in post:

https://stackoverflow.com/questions/16594768/how-to-write-simple-speed-test-app-with-cuda

this time i'm not cuda, code of application in post. issue want face application pretty unstable in case of total score returns. after first time compiled it returning value between 12.2 - 12.5 mld test time equal 10 secons today after pc turn off , on keeps returning value approx. 15 mld same test time. thought moment happened pc, in other professional tests it's more stable - eg. mdcrackgui benchmark returns me approx. 132 million first value every time run it. after moment of clever thinking had fallowing questions:

  1. i have 8 logical cpu cores, i'm not sure each computing thread using 1 , same logical core while test running. how modify code ensure if it's possible ?

  2. there 8 computing threads have 4 not 8 physical core cpu(because of ht technology). guess means 8 threads won't run in parallel. if there positive answer first question wouldn't app more stable if use 4 computing threads, each on diffrent physical core ?

i don't have experience cuda on cpu(only used gpu), threads assigned cpu cores os. can force thread run on specified cpu core not recommended. os knows best core best run thread since knows other load on core outside program.

for second question, hyperthreading concept works on fact thread/process have lot of "downtime" while waiting data ram , io(like harddrive, network etc.), in case ram. while thread waiting read or write complete, core switch thread. hyperthreading fast within parameters(like within same program code), , in io , ram heavy processes can make seem have 8 cores instead of 4. in program write variable every running thread, benefit running 8 computing threads.

more info on ht: https://en.wikipedia.org/wiki/hyper-threading

of course, best thing test. test 4 threads, test 8 threads. there no definitive "correct" answer. can different computer computer.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -