http:^^www.cs.washington.edu^education^courses^551^assignments^hw1.html

来自「This data set contains WWW-pages collect」· HTML 代码 · 共 60 行

HTML
60
字号
Date: Mon, 02 Dec 1996 15:06:16 GMTServer: NCSA/1.4.2Content-type: text/html<title>Assignment 1</title><h1>Assignment 1 -- Getting Started</h1><h2>Due Thursday April 11.</h2>This assignment is intended to (re)familiarize you with programming in C and UNIX.  It should also serve to convince you that kernel operations areexpensive, and that reducing or eliminating such operations might greatly improve program performance.<p>Please note that this is an individual assignment. You should do yourown measurements and turn in your own results, although this certainlydoesn't mean that you cannot discuss with others what you are doing.In the project, you may work in groups of two or three.<ol><li> <b>Timing simple UNIX system calls.</b><p>We mentioned in class that system calls take much more time than regular procedure calls.  Show that this is the case by timing how long system calls take to execute as opposed to procedure calls.  You will need to usethe standard UNIX timing facility gettimeofday().  The UNIX timer only hasa granularity of about 10ms, so you will need to execute each timed operationa large number of times in order to get accurate results.  The system call getpid() is extremely simple, and so would be a good candidate for measurement.Remember to factor out any timing overhead that you may introduce.<p><li> <b>UNIX Processes.</b><p>Use the timing mechanism that you built for part 1 to time how long it takes for create and destroy a UNIX process using the fork(), exit() system calls.</ol><h3> Turning in</h3>You should turn in <ul><li> your timing code<li> the results<li> a description of the computer on which they were gathered</ul><p>You might find the following man pages helpful: <ul> <li> gettimeofday <li> getpid <li> fork <li> exit <li>  ps</ul>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?