当前位置: 技术问答>linux和unix
user ,real ,system time 分别是什么意思?在超线程中是如何统计的?
来源: 互联网 发布时间:2015-05-08
本文导语: 如题。真正做一个超线程的实验。用p4 2.4c 从一个线程到4个线程用的时间分别是。 1 system 0m0.360s real 2m10.782s user 2m10.360s 2 system 0m0.660s real 3m52.262s user 7m42.460s 3 system 0m1.240s real 6m4.223s user 12m2.260s 4 system 0m1.560s real...
如题。真正做一个超线程的实验。用p4 2.4c
从一个线程到4个线程用的时间分别是。
1
system 0m0.360s
real 2m10.782s
user 2m10.360s
2
system 0m0.660s
real 3m52.262s
user 7m42.460s
3
system 0m1.240s
real 6m4.223s
user 12m2.260s
4
system 0m1.560s
real 8m16.185s
user 16m26.400s
请大家帮我分析一下如何用这些数据分析超线程的性能。
源程序:
#include
#include
#define NUM_THREADS 0
void *PrintHello(void *threadid)
{ int done = 0, n=500000, myid, numprocs;
float pi[201];
int namelen;
FILE *fp;
clock_t start, finish;
double duration, loop_calc;
int t,i,j,k;
printf("n%d: Hello World!n", threadid);
start = clock();
for(i=1;i
从一个线程到4个线程用的时间分别是。
1
system 0m0.360s
real 2m10.782s
user 2m10.360s
2
system 0m0.660s
real 3m52.262s
user 7m42.460s
3
system 0m1.240s
real 6m4.223s
user 12m2.260s
4
system 0m1.560s
real 8m16.185s
user 16m26.400s
请大家帮我分析一下如何用这些数据分析超线程的性能。
源程序:
#include
#include
#define NUM_THREADS 0
void *PrintHello(void *threadid)
{ int done = 0, n=500000, myid, numprocs;
float pi[201];
int namelen;
FILE *fp;
clock_t start, finish;
double duration, loop_calc;
int t,i,j,k;
printf("n%d: Hello World!n", threadid);
start = clock();
for(i=1;i