多线程的效率  被引量:6

Efficiency of multithread

在线阅读下载全文

作  者:郭辉[1] 

机构地区:[1]常熟理工学院计算机科学与工程学院,江苏常熟215500

出  处:《计算机应用》2008年第S2期141-143,共3页journal of Computer Applications

摘  要:用Java语言定义了一个线程类,并用System类中的静态方法currentTimeMillis()计算时间,从而比较了用不同个数的线程求数组元素和的时间。通过实验证明在Linux、Windows 2000 Advanced Server和Windows XPProfessional系统中,在加数个数一定的条件下,并不是线程数越多,效率越高,而是要用合适的线程数。同时通过分析了在Windows XP Professional中,不同配置的计算机线程个数与加数的关系相似。A thread class was defined in the Java language,and the times of determining the summation of elements in an array in different number of threads were compared.The calculation cost was obtained with the static method currentTimeMillis() in the system class.Given the definite number of addend,based on the most popular operating systems such as Linux,Windows 2000 Advanced Server,Windows XP Professional,the experiments show that not the more the number of the threads is,the better the efficiency is.In the meanwhile,the relation between the number of the threads and the number of addends was discussed.Based on Windows XP Professional,the experiment shows that the relation between the number of the threads and the number of the addends is similar on PCs with different configuration.

关 键 词:JAVA语言 线程 效率 数组 

分 类 号:TP311.52[自动化与计算机技术—计算机软件与理论]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象