作业1:
Read the man page for the time command for observing various timing measurements on Linux.
Run the timing experiments for the suggested number of test runs and record the results.
Use the Linux sort command. You will need a large datafile. This can be any text document and can be concatenated mutltiple times to produce a large enough file. Note that if the file is too small, you will not get a useful measurement. Also, keep an unsorted copy so you can repeat the tests.
Write your observations regarding the timing experiments:
Include the data with your observations.
Comment on the differences between the types of time measurements supplied by the time command and how you used each one.
作业2: 编程
Write a simple program that exercises various system resources such as memory allocation, CPU usage, and I/O usage. Design a calculation for some expression and run a range of values in the expression in a loop. You will need to make a large number of iterations to make this work so you can time it.
Using the time command under Unix, measure the time required for the program to run. Divide each time by the number of operations that the program reports. Estimate running time based on the number of operations your program will use.
Analyze the code and timing. Compare the three program types (memory allocation bound, CPU bound, and I/O bound) and speculate on why differences may occur.作者: funkys 时间: 2011-10-15 09:21
记录结果。使用Linux的 sort命令。您将需要一个大的数据文件。这可以是任何文本文件,并可以连接在一起mutltiple倍,产生足够大的文件。请注意,如果该文件是太小了,你不会得到一个有用的测量 。此外,保持一个未排序的副本,所以你可以重复测试 。写入您的意见的时机 实验:包括与你的观测 数据。评论之间的时间测量时间命令提供的类型,以及如何您使用的每一个差异。 作业2:编程 写一个简单的程序行使各种系统资源,如内存分配,CPU使用率和I / O使用率 。设计某些表达式的计算和运行在一个循环中的表达的一个值的范围。您将需要进行大量的迭代,使这项工作,这样你就可以时间 。Unix下使用的时间命令,测量程序运行所需的时间 。除以的操作数,该计划的报告,每次 。你的程序基础上的操作数的估计运行时间将 使用分析代码和定时 。比较三个方案类型(内存分配的约束CPU束缚,I / O绑定),并猜测为什么差异可能发生作者: wdstar 时间: 2011-10-15 09:22
- - 求辅导,没求软翻作者: 蛰伏 时间: 2011-10-15 09:24
你在美国上学吗?作者: wdstar 时间: 2011-10-15 09:25