http:^^www.cs.washington.edu^education^courses^451^currentquarter^projects^projects.html
来自「This data set contains WWW-pages collect」· HTML 代码 · 共 172 行
HTML
172 行
Date: Mon, 02 Dec 1996 14:46:11 GMTServer: NCSA/1.4.2Content-type: text/html<html><header><title>CSE 451 Projects</title></header><body><center> <h1>CSE 451</h1> <h2>Introduction to<br>Operating Systems</h2> <h3>Autumn 1996</h3> <hr> <h2>Projects</h2></center><b>NOTE:</b> As always, you are free to work on any platform, but itis your responsibility to make sure what you hand in works on the CSinstructional machines (lynx, wolf or grizzly). The source codeprovided throughout the quarter will be written in C. You are free touse C++, but it will not be supported.<p><dl><dd><p><b>The <tt>turnin</tt> program is now accepting the intermdiatesubmission for Project 4 and the Java extra credit assignment.</b></dd></dl><p><hr><p><dl><dt>1. <a href="project1.html">C Programming and Debugging</a> (<a href=#p1_solution>solution</a>)<dd>This project is out Monday 9/30/96 and is due Monday 10/7/96</dd><p><dt>2. <a href="project2.html">Threads and Synchronization</a> (<a href=#p2_solution>solution</a>)<dd>This project is out Wednesday 10/9/96 and is due Friday 10/25/96<p><dt>3. <a href="project3.html">System Calls and Virtual Memory</a><dd> (The project description has an accompanying <ahref="project3-appendix.html">Appendix</a>) This project is outThursday 10/31/96 and is due Monday 11/18/96. There is also anintermediate due date Friday 11/8/96 <p><dt>4. <a href="project4.html">DOS File system</a><dd>This project is out Monday 11/25/96 and is due Wednesday 12/11/96.There is also an intermediate due date Wednesday 12/4/96 <p><dt>5. <a href="java-proj.html">Extra Credit Java Assignment</a><dd>This assignment is out Monday 11/25/96 and is due Friday 12/6/96 <p></dl><hr><center> <h2>Project Solutions</h2></center><dl><a name="p1_solution"><dt><b>Project 1.</b><ul><li> <a href=./project1/queue.c>queue.c</a> (here's my version of <a href="./project1/queuetest.c">queuetest.c</a>)<li> <a href=./project1/timegetpid.c>timegetpid.c</a></ul><p><dd><b>Notes</b>: When using <tt>gettimeofday</tt>, you get back avalue in seconds and microseconds. If you want to time something, youwill need to call <tt>gettimeofday</tt> twice, once to get the starttime, <tt>start_tp</tt>, and again to get the ending time,<tt>end_tp</tt>. To find the elapsed time, it is not enough tosubtract the seconds field of <tt>start_tp</tt> from the seconds fieldof <tt>end_tp</tt> and similarly with the microseconds field (you canget an incorrect value for the number of seconds and a negative valuefor the microseconds). You must first convert to a common unit,either a floating point value of seconds or an integer value ofmicroseconds, and then do the subtraction.<pre> start = (double) start_tp->tv_sec + ((double) start_tp->tv_usec)*(1.0e-6); end = (double) end_tp->tv_sec + ((double) end_tp->tv_usec)*(1.0e-6); elapsed_time = end - start;</pre></dt><a name="p2_solution"><dt><b>Project 2.</b><p>Below is my solution for the preemptive minithread system. Iimplemented spinlocks and had a few extra header files. Notice thatif you actually destroy threads in <tt>semaphore_destroy</tt>, youneed a special destroy routine that doesn't actually stop the thread(like the one you use to destroy threads in your minithread system).Look for <tt>minithread_destroy</tt> and<tt>minithread_destroy_internal</tt> in minithread.c and synch.c to see the difference.<p><ul><li> <a href=./project2/minithread.c>minithread.c</a> (minithread package)<li> <a href=./project2/synch.c>synch.c</a> (semaphore implementation)<li> <a href=./project2/my_malloc.c>my_malloc.c</a> (safe malloc)<li> <a href=./project2/spinlock.c>spinlock.c</a> and <a href=./project2/spinlock.h>spinlock.h</a> (spinlocks)<li> and a few extra header files: <a href=./project2/panic.h>panic.h</a> (for errors), <a href=./project2/minithread_export.h>minithread_export.h</a> (other exported routines)</ul><p>For the bounded buffer problem, I use three semaphores:<tt>empty_s</tt> and <tt>full_s</tt> to synchronize the producers andconsumers, and <tt>pool_s</tt> to manage accesses to the buffer pool.In addition, I provide three command line options that enable the userto choose the number of producers, the number of consumers and the sizeof the buffer pool (this was not part of the assignment).<p><ul><li> <a href=./project2/boundbuf.c>boundbuf.c</a></ul><p>For the cigarette problem, I use four semaphores: an array<tt>needed</tt>, one for each ingredient and <tt>empty</tt> toindicate that there is nothing on the table. The way to think of thisis that each of the three smokers (each has a different ingredient)P's on a semaphore that is signalled when the other two ingredientsare there. The agent randomly V's on one of these semaphores. I alsoprovided three command line options that allow you to control theagent. In particular, by default the agent puts ingredients on thetable, each with equal probability, <em>i.e.</em>, in the limit, eachsmoker will smoke about the same number of cigarettes. The ratio ofsmokers smoking is <tt>1:1:1</tt>. You can use the command lineoptions to change this ratio (this was not part of the assignment).<p><ul><li> <a href=./project2/cigarette.c>cigarette.c</a></ul></dt></dl><p><hr></body><address><a href = "mailto:cse451-webmaster@cs.washington.edu">cse451-webmaster@cs.washington.edu</a></address></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?