<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>

<channel>
	<title>CS 450 Update Log</title>
	<atom:link href="http://cs450.updatelog.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://cs450.updatelog.org</link>
	<description>Operating Systems Course Blog</description>
	<pubDate>Wed, 19 Aug 2009 00:04:14 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Course website moved!</title>
		<link>http://cs450.updatelog.org/2009/08/18/course-website-moved/</link>
		<comments>http://cs450.updatelog.org/2009/08/18/course-website-moved/#comments</comments>
		<pubDate>Wed, 19 Aug 2009 00:04:14 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
		
		<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://cs450.updatelog.org/2009/08/18/course-website-moved/</guid>
		<description><![CDATA[If you&#8217;re here looking for the current CS 450 website, it&#8217;s moved!

The site is now located at http://cs.iit.edu/~lee/cs450
]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re here looking for the current CS 450 website, it&#8217;s moved!</p>

<p>The site is now located at <a href="http://cs.iit.edu/~lee/cs450" onclick="javascript:pageTracker._trackPageview('/outbound/article/cs.iit.edu');">http://cs.iit.edu/~lee/cs450</a></p>
]]></content:encoded>
			<wfw:commentRss>http://cs450.updatelog.org/2009/08/18/course-website-moved/feed/</wfw:commentRss>
		</item>
		<item>
		<title>v6 Sample Problem Set</title>
		<link>http://cs450.updatelog.org/2009/07/19/v6-sample-problem-set/</link>
		<comments>http://cs450.updatelog.org/2009/07/19/v6-sample-problem-set/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 05:26:19 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
		
		<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://cs450.updatelog.org/?p=148</guid>
		<description><![CDATA[Following is a set of problems that should help you prepare for the v6 portion of the upcoming exam:


Describe the memory management facilities of the PDP11/40.  Specifically, detail the physical/virtual address spaces, and the mapping mechanism used by the MMU.
What is the resulting memory mapping by the end of line 0669?  Does proc [...]]]></description>
			<content:encoded><![CDATA[<p>Following is a set of problems that should help you prepare for the v6 portion of the upcoming exam:</p>

<ul>
<li><p>Describe the memory management facilities of the PDP11/40.  Specifically, detail the physical/virtual address spaces, and the mapping mechanism used by the MMU.</p></li>
<li><p>What is the resulting memory mapping by the end of line 0669?  Does proc 0&#8217;s user structure necessarily begin at the beginning of the 6th physical page?  Why or why not?</p></li>
<li><p>What is the structure always to be found at virtual address 140000 in the kernel&#8217;s address space?  What is the significance of this structure, and what must the kernel do with it when switching to a different process?</p></li>
<li><p>What does the stack pointer point to after line 2228 in the first call to <code>swtch</code>, after the kernel booted?</p></li>
<li><p>What data structures are associated with each process in v6?  Describe the roles that they play during a process&#8217;s lifetime.</p></li>
<li><p>Annotate every line of assembly code for the function <code>_retu</code>, from lines 0740-0749.  What does each statement do, and why?</p></li>
<li><p>Explain why the calls to <code>savu</code> and <code>retu</code> are found in the <code>swtch</code> routine at lines 2189, 2193, and 2228.  You should describe the processes involved during the function&#8217;s execution.</p></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://cs450.updatelog.org/2009/07/19/v6-sample-problem-set/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Assignment 3: File Systems</title>
		<link>http://cs450.updatelog.org/2009/07/16/assignment-4-file-systems/</link>
		<comments>http://cs450.updatelog.org/2009/07/16/assignment-4-file-systems/#comments</comments>
		<pubDate>Thu, 16 Jul 2009 13:57:01 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
		
		<category><![CDATA[Assignments]]></category>

		<guid isPermaLink="false">http://cs450.updatelog.org/?p=196</guid>
		<description><![CDATA[Your solutions to this assignment must be typed up, printed, and submitted by July 22nd at the beginning of lecture. Internet students should submit their work via Blackboard by the same date.


Suppose that we would like to use a File Allocation Table (FAT) based filesystem to support a 4TB (4 x 1012 byte) drive.


If files [...]]]></description>
			<content:encoded><![CDATA[<p>Your solutions to this assignment must be typed up, printed, and submitted by <strong>July 22nd</strong> at the beginning of lecture. Internet students should submit their work via Blackboard by the same date.</p>

<ol>
<li><p>Suppose that we would like to use a File Allocation Table (FAT) based filesystem to support a 4TB (4 x 10<sup>12</sup> byte) drive.</p>

<ul>
<li>If files are to be allocated in 4KB (4096 byte) blocks (i.e., 4KB is the minimum granularity of allocation, and correspond to a single FAT entry), how large, at a minimum, must the FAT structure itself be? Justify your answer. <em>(5 points)</em></li>
<li>If files are allocated in 1MB (2<sup>20</sup> byte) blocks, how large must the FAT structure be? <em>(5 points)</em></li>
</ul></li>
<li><p>Consider an i-node based filesystem such as UFS with the following properties:</p>

<ul>
<li>Blocks are 8KB large</li>
<li>Block pointers are 64-bits in size</li>
<li><p>Each I-node consists of the following:</p>

<ul>
<li>4 single indirect block pointers</li>
<li>2 double indirect block pointers</li>
<li>1 triple indirect block pointer</li>
</ul></li>
</ul>

<p>What is the maximum file size supported by the file system described above? Show your work. <em>(10 points)</em></p></li>
<li><p>Assume that, in a RAID 3 system with byte level parity and a dedicated parity disk, that we have lost one of the 4 RAID-ed disk drives. Compute and fill in the column below with byte values recovered using the parity drive:  <em>(5 points)</em></p>

<p><img src="http://cs450.updatelog.org/wp-content/uploads/2009/04/picture-1.png" alt="Table for exercise 3" /></p></li>
<li><p>Suppose that you&#8217;ve been asked by a database administrator to help recommend a RAID implementation to support a high throughput file system. Single drive failure must be tolerated, at a minimum. Due to limited funding, you are restricted to purchasing a maximum of 20 1TB drives, and it&#8217;s crucial that the final setup allow for at least 75% of the full capacity.</p>

<p>Can you recommend a setup consisting of nested RAID levels, or a hybrid approach? Justify your answer.  <em>(5 points)</em></p></li>
<li><p>Consider a filesystem that supports the strategies of contiguous, linked, and index allocation. What criteria should be used in deciding which strategy is best used for a particular file? Use examples to justify your answer.  <em>(5 points)</em></p></li>
<li><p>Give an example of how Isolation (of the ACID properties) might be important in the context of a file system. <em>(5 points)</em></p></li>
<li><p>Consider a filesystem with journaling support. Upon reboot following a crash, the following entries are discovered in the journal:</p>

<pre><code>&lt;transaction&gt;
  &lt;del /home/lee/foo&gt;
  &lt;free 319&gt;
  &lt;free 12019&gt;
&lt;/transaction&gt;
&lt;transaction&gt;
  &lt;del /home/lee/bar&gt;
  &lt;free 40
</code></pre>

<p>Describe what must have happened before the filesystem crashed. What actions should be taken to ensure the filesystem is consistent? Is it possible to carry out any of logged transactions?  <em>(5 points)</em></p></li>
<li><p>Consider that the throughput of a file system implementation is closely tied to how well it allows for contiguous access to the data blocks of a file. While it is theoretically possible for both FAT and UFS filesystems to contain large amounts of fragmentation, the latter is typically seen as more &#8220;resistant&#8221; to the problem.</p>

<p>What about the UFS filesystem makes it inherently easier to allocate file blocks in such a way as to lessen file fragmentation? What makes it more difficult when using FAT? <em>(5 points)</em></p></li>
<li><p>Consider the following set of block address requests, arriving in the order specified, with a constant inter-arrival time of 5ms:  20, 11, 40, 19, 5, 6</p>

<p>There is a single head, and there are 50 cylinders, each of which contains a single sector/block.  Head movement (seek) time is linear in the number of sectors <em>n</em> to traverse, and can be described with the formula 5 + <em>n</em>; e.g., seeking across 4 cylinders requires 5+4=9ms. Access times are ignored for this problem.</p>

<p>Given a current head position of 14, and that the previous block accessed was 8, compute the total seek time for each of the following head scheduling algorithms over the block requests given above.</p>

<ul>
<li>SSTF <em>(4 points)</em></li>
<li>LOOK <em>(4 points)</em></li>
<li>C-LOOK <em>(4 points)</em></li>
</ul></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://cs450.updatelog.org/2009/07/16/assignment-4-file-systems/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Assignment 2: Studies in Synchronization</title>
		<link>http://cs450.updatelog.org/2009/06/29/assignment-2-studies-in-synchronization/</link>
		<comments>http://cs450.updatelog.org/2009/06/29/assignment-2-studies-in-synchronization/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 01:55:41 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
		
		<category><![CDATA[Assignments]]></category>

		<guid isPermaLink="false">http://cs450.updatelog.org/?p=156</guid>
		<description><![CDATA[The solutions to this assignment must be typed up, printed, and submitted by July 6th at the beginning of lecture. Internet students should submit their work via Blackboard by the same date.

Coded solutions must be properly formatted and indented.

1. Deadlock in the barrier non-solution

On page 25 of The Little Book of Semaphores (TLBoS) (in listing [...]]]></description>
			<content:encoded><![CDATA[<p>The solutions to this assignment must be typed up, printed, and submitted by <strong>July 6th</strong> at the beginning of lecture. Internet students should submit their work via Blackboard by the same date.</p>

<p>Coded solutions must be properly formatted and indented.</p>

<h3>1. <strike>Deadlock</strike> in the barrier non-solution</h3>

<p>On page 25 of <a href="http://www.greenteapress.com/semaphores/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.greenteapress.com');">The Little Book of Semaphores (TLBoS)</a> (in listing 3.4), a non-working solution to the barrier pattern is presented in which deadlock is likely to occur.  It is, however, possible &#8212; though unlikely &#8212; that the code could be executed by multiple threads in such a way as to avoid deadlock. Describe such a path through the given barrier code for 5 threads.</p>

<h3>2. Completing the Generalized Smokers Solution</h3>

<p>The generalized solution for the smokers problem, as presented on page 119 of TLBoS (in listing 4.46), is incomplete &#8212; in addition to Pusher A, which is woken when tobacco is placed on the table, and the smoker holding tobacco (shown in listing 4.44), we need the code for Pushers B and C, and the smokers holding paper and matches to complete the solution.</p>

<p>Write up the code for Pushers B and C and the aforementioned smokers &#8212; you should adhere to the semaphore names and conventions established by the existing code.</p>

<h3>3. The Dance Mixer Problem</h3>

<p>At the Willowbrook Ballroom, the band is always playing a Waltz, a Tango, or a Foxtrot, and there is at all times a group of dancers (men and women) on hand, each of whom can dance two of these three dances.</p>

<p>Each dancer waits in a gender appropriate line for the dance he/she is capable of dancing until the corresponding music is played by the band. When the music starts playing, he/she waits to be paired up with a dancer of the opposing gender also waiting for the same dance. After they complete the dance, each dancer lines up for the next dance they are capable of dancing &#8212; the band continues to play the music until there are no couples on the dance floor. At this point the band starts to play music for the next dance, and the affair starts over again.</p>

<p>Implement a semaphore based solution (that avoids deadlock and race conditions) for the Dance Mixer problem.</p>

<p>Be sure to first list the variables used in your solution (names, types, and values), and then your coded solution. You should clearly identify each thread and what it represents (dancer, band, etc.) Comment the code to your satisfaction.</p>

<h3>4. The Gaming Lab Problem</h3>

<p>Bowing to popular demand, the residence hall association has invested in a &#8220;lab&#8221; consisting of 5 high-performance gaming PCs. Usage of the game lab is restricted, however, to students belonging to the Rho-Theta-Sigma (RTS), Rho-Pi-Gamma (RPG), and Phi-Pi-Sigma (FPS) fraternities.</p>

<p>At any given moment, the lab may be occupied by a group of no more than 5 students from a single fraternity, and as other students from the various fraternities arrive at the door they form separate lines waiting to enter the room. When the current group of students finishes their game and exits, another group of students formed from one of the lines enters. If the selected line has fewer than 5 students, all the students in that line will enter as a group, otherwise a group of 5 will be selected to enter.</p>

<p>Note that once a group of students enters the lab, no additional students may enter the room, regardless of the size of the group or which fraternity they belong to. It is also important to guarantee that no single fraternity is starved of the game lab &#8212; e.g., if RTS is currently using the lab and there is a mile-long line for RTS but one waiting student from RPG, the latter group will be allowed to enter.</p>

<p>Implement a semaphore based solution for the Gaming Lab problem.</p>

<p>Be sure to first list the variables used in your solution (names, types, and values), and then your coded solution. You should clearly identify each thread and what it represents (dancer, band, etc.) Comment the code to your satisfaction.</p>
]]></content:encoded>
			<wfw:commentRss>http://cs450.updatelog.org/2009/06/29/assignment-2-studies-in-synchronization/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Lion&#8217;s Commentary and UNIXv6 Source</title>
		<link>http://cs450.updatelog.org/2009/06/23/lions-commentary-and-unixv6-source/</link>
		<comments>http://cs450.updatelog.org/2009/06/23/lions-commentary-and-unixv6-source/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 07:21:14 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
		
		<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://cs450.updatelog.org/?p=109</guid>
		<description><![CDATA[You can download the full text of the Lion&#8217;s Commentary on UNIX here, and the sectioned UNIXv6 source code here.

In addition, you may also find this PDP-11 Handbook a handy reference.

I strongly advise you to print this material out and bring it to class if you do not plan on purchasing the dead-tree version. If [...]]]></description>
			<content:encoded><![CDATA[<p>You can download the full text of the Lion&#8217;s Commentary on UNIX <a href="http://updatelog.org/files/lions-v6commentary.pdf" onclick="javascript:pageTracker._trackPageview('/downloads/files/lions-v6commentary.pdf');">here</a>, and the sectioned UNIXv6 source code <a href="http://updatelog.org/files/v6src.pdf" onclick="javascript:pageTracker._trackPageview('/downloads/files/v6src.pdf');">here</a>.</p>

<p>In addition, you may also find this <a href="http://updatelog.org/files/PDP-11%20Handbook.pdf" onclick="javascript:pageTracker._trackPageview('/downloads/files/PDP-11%20Handbook.pdf');">PDP-11 Handbook</a> a handy reference.</p>

<p>I <strong>strongly advise you to print this material out and bring it to class</strong> if you do not plan on purchasing the dead-tree version. If you do, it&#8217;s available <a href="http://www.amazon.com/Lions-Commentary-Unix-John/dp/1573980137" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.amazon.com');">on Amazon</a> for much less than most other course textbooks.</p>
]]></content:encoded>
			<wfw:commentRss>http://cs450.updatelog.org/2009/06/23/lions-commentary-and-unixv6-source/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Site updated!</title>
		<link>http://cs450.updatelog.org/2009/06/18/site-updated/</link>
		<comments>http://cs450.updatelog.org/2009/06/18/site-updated/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 00:08:34 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
		
		<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://cs450.updatelog.org/?p=253</guid>
		<description><![CDATA[Finally managed to wrestle the blog into submission &#8212; the assignment below has been updated, and slides are posted. Note the extended due date.
]]></description>
			<content:encoded><![CDATA[<p>Finally managed to wrestle the blog into submission &#8212; the assignment below has been updated, and slides are posted. Note the extended due date.</p>
]]></content:encoded>
			<wfw:commentRss>http://cs450.updatelog.org/2009/06/18/site-updated/feed/</wfw:commentRss>
		</item>
		<item>
		<title>CPU Scheduling (and other) Simulators</title>
		<link>http://cs450.updatelog.org/2009/06/17/cpu-scheduling-and-other-simulators/</link>
		<comments>http://cs450.updatelog.org/2009/06/17/cpu-scheduling-and-other-simulators/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 22:47:36 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
		
		<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://cs450.updatelog.org/?p=141</guid>
		<description><![CDATA[The CPU Scheduling simulator you need for some of the problems in assignment 1 can be found at the UTSA CS Simulators website &#8212; look for the &#8220;Process (CPU) Scheduling&#8221; simulator download. Detailed documentation for the simulator can also be found on the website.

If you like, you can also obtain the simulator via the git [...]]]></description>
			<content:encoded><![CDATA[<p>The CPU Scheduling simulator you need for some of the problems in assignment 1 can be found at the <a href="http://vip.cs.utsa.edu/simulators/" onclick="javascript:pageTracker._trackPageview('/outbound/article/vip.cs.utsa.edu');">UTSA CS Simulators website</a> &#8212; look for the &#8220;Process (CPU) Scheduling&#8221; simulator download. Detailed <a href="http://vip.cs.utsa.edu/simulators/guides/ps/ps_doc.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/vip.cs.utsa.edu');">documentation</a> for the simulator can also be found on the website.</p>

<p>If you like, you can also obtain the simulator via the <a href="http://git-scm.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/git-scm.com');">git</a> version control system by cloning the CS 450 course repository &#8212; do this with the following command:</p>

<pre><code>git clone git://github.com/michaelee/cs450.git
</code></pre>

<p>Look under the <code>sim/ps</code> directory of the cloned repository.</p>

<p>For those interested in some extracurricular hacking, you can also find a PDP-11 simulator under the <code>sim/simhv</code> directory (courtesy of the <a href="http://simh.trailing-edge.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/simh.trailing-edge.com');">Computer History Simulation Project</a>). Compile it with <code>make</code>, and you&#8217;ll find the simulator binary at <code>./bin/pdp11</code>.</p>

<p>Running v6 is then a matter of downloading the <a href="http://simh.trailing-edge.com/kits/uv6swre.zip" onclick="javascript:pageTracker._trackPageview('/outbound/article/simh.trailing-edge.com');">software kit</a>, unpacking it, and attaching to it in the simulator and booting up: (I moved the pdp11 binary into the unpacked v6 package directory before starting, below)</p>

<pre><code>foxtrot:uv6swre$ ./pdp11

PDP-11 simulator V3.7-3
sim&gt; set cpu u18
sim&gt; att rk0 unix0_v6_rk.dsk
sim&gt; att rk1 unix1_v6_rk.dsk
sim&gt; att rk2 unix2_v6_rk.dsk
sim&gt; att rk3 unix3_v6_rk.dsk
sim&gt; boot rk0
@unix

login: root
# ls -l
total 182
drwxr-xr-x  2 bin      1040 Jan  1  1970 bin
drwxr-xr-x  2 bin       352 Jan  1  1970 dev
drwxr-xr-x  2 bin       304 Aug 20 12:18 etc
drwxr-xr-x  2 bin       336 Jan  1  1970 lib
drwxr-xr-x 17 bin       272 Jan  1  1970 mnt
drwxr-xr-x  2 bin        32 Jan  1  1970 mnt2
-rw-rw-rw-  1 root    28472 Aug 20 12:01 rkunix
-rwxr-xr-x  1 bin     28636 Aug 20 11:38 rkunix.40
drwxrwxrwx  2 bin       144 Aug 20 12:14 tmp
-rwxr-xr-x  1 bin     28472 Aug 20 12:01 unix
drwxr-xr-x 13 bin       224 Aug 20 12:22 usr
drwxr-xr-x  2 bin        32 Jan  1  1970 usr2
</code></pre>

<p>You can find more instructions on the PDP-11 simulator <a href="http://simh.trailing-edge.com/pdf/pdp11_doc.pdf" onclick="javascript:pageTracker._trackPageview('/outbound/article/simh.trailing-edge.com');">here</a>, and on using the v6 software package <a href="http://simh.trailing-edge.com/pdf/simh_swre.pdf" onclick="javascript:pageTracker._trackPageview('/outbound/article/simh.trailing-edge.com');">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://cs450.updatelog.org/2009/06/17/cpu-scheduling-and-other-simulators/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Assignment 1: CPU Scheduling</title>
		<link>http://cs450.updatelog.org/2009/06/17/assignment-1-cpu-scheduling/</link>
		<comments>http://cs450.updatelog.org/2009/06/17/assignment-1-cpu-scheduling/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 06:01:57 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
		
		<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://cs450.updatelog.org/?p=135</guid>
		<description><![CDATA[In this assignment you&#8217;ll try your hand at (manually) simulating a number of scheduling algorithms discussed in lecture.  Please type up your submissions and show all your work for full credit — handwritten work will not be accepted!  (Diagrams may be neatly hand drawn with a ruler, if you&#8217;re not comfortable doing those [...]]]></description>
			<content:encoded><![CDATA[<p>In this assignment you&#8217;ll try your hand at (manually) simulating a number of scheduling algorithms discussed in lecture.  Please type up your submissions and show all your work for full credit — <strong>handwritten work will not be accepted!</strong>  (Diagrams may be neatly hand drawn with a ruler, if you&#8217;re not comfortable doing those on a computer).</p>

<p>Submissions are due <strong>6/24/09</strong> at the beginning of lecture.  Internet/TV students please have your work submitted via the blackboard digital dropbox by then.</p>

<div class="exercise">

<h3>Exercise 1</h3>

<p>Consider the following set of processes with the given CPU-burst lengths and arrival times:</p>

<table>
<tr><th>Process</th><th>CPU Burst</th><th>Arrival Time</th></tr>
<tr><td>P0</td><td>  2</td><td>  0</td></tr>
<tr><td>P1</td><td> 10</td><td> 1</td></tr>
<tr><td>P2</td><td>  6</td><td>  5</td></tr>
<tr><td>P3</td><td>  3</td><td>  7</td></tr>
</table>

<ol>
<li>Draw four Gantt charts illustrating the execution of these processes using the FCFS, non-preemptive SJF, preemptive SJF, and RR (quantum=2) scheduling algorithms.</li>
<li>What is the average turnaround time for each of the scheduling algorithms in part (1)? Show how you compute your answer.</li>
<li>What is the average waiting time for each of the scheduling algorithms in part (1)? Show how you compute your answer.</li>
<li>Which of the scheduling algorithms results in the minimum average waiting time in part (1)?</li>
</ol>

</div>

<h3>The Process Scheduling Simulator</h3>

<p>Consider the following run setup for the scheduling simulator:</p>

<pre><code>seed 5000
numprocs 10
firstarrival 0.0
interarrival constant 0.0
duration constant 50
cpuburst exponential 5
ioburst exponential 10
</code></pre>

<p>The following experiment configures the above run with the SJF, preemptive-SJF, and SJFA 0.5 (CPU burst duration predicted using an EMA with a configured alpha of 0.5) algorithms:</p>

<pre><code>run alpharun algorithm SJF key "SJF"
run alpharun algorithm PSJF key "PSJF"
run alpharun algorithm SJFA 0.5 key "SJFA"
</code></pre>

<p>Create the necessary configuration files — you may need to add some of your own lines — and run the simulator with the given settings.  Refer to the output for exercise 2.  Exercises 3 and 4 asks you to make some modifications to the run settings.</p>

<div class="exercise">

<h3>Exercise 2</h3>

<p>Which of the scheduling algorithms completes all 10 processes in the least amount of time (and consequently achieves the best CPU utilization)?  Referring to the Gantt charts for the three algorithms, explain in general terms <em>why</em> this happens.  It may help in particular to examine how processes 2 and 10 are scheduled.</p>

</div>

<div class="exercise">

<h3>Exercise 3</h3>

<p>For our setup we specified an <em>exponential distribution</em> for CPU burst durations.  You can read about exponential distributions at <a href="http://en.wikipedia.org/wiki/Exponential_distribution" onclick="javascript:pageTracker._trackPageview('/outbound/article/en.wikipedia.org');">Wikipedia</a> — they are particularly useful when modeling/simulating the inter-arrival times or durations (as in our case) of events in certain systems where the mean inter-arrival time or duration is known.</p>

<p>First, change the duration of the processes in the simulated run to 1000 (so that the simulation is somewhat lengthier).  Via either prediction or experimentation, can you determine an optimal value (to one decimal place) for <em>alpha</em> for the SJFA algorithm?  Explain your reasoning for why it is optimal.</p>

</div>

<div class="exercise">

<h3>Exercise 4</h3>

<p>Modify the (original) run above by adding context switch times to the experiment.  You can do this by inserting the following lines in the run file after the <code>seed</code> setting:</p>

<pre><code>cstin 0.5
cstout 0.5
</code></pre>

<p>Run the experiment again.  Are there any changes in the overall (and relative) performance of the algorithms?  Explain your observed changes.</p>

</div>
]]></content:encoded>
			<wfw:commentRss>http://cs450.updatelog.org/2009/06/17/assignment-1-cpu-scheduling/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Scheduling Slides</title>
		<link>http://cs450.updatelog.org/2009/06/16/scheduling-slides/</link>
		<comments>http://cs450.updatelog.org/2009/06/16/scheduling-slides/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 19:43:12 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
		
		<category><![CDATA[Lectures]]></category>

		<guid isPermaLink="false">http://cs450.updatelog.org/?p=139</guid>
		<description><![CDATA[Download the slides on CPU/Disk Scheduling here.
]]></description>
			<content:encoded><![CDATA[<p>Download the slides on CPU/Disk Scheduling <a href="http://cs450.updatelog.org/wp-content/uploads/2009/03/scheduling.pdf" onclick="javascript:pageTracker._trackPageview('/downloadscs450./wp-content/uploads/2009/03/scheduling.pdf');" title="scheduling.pdf">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://cs450.updatelog.org/2009/06/16/scheduling-slides/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Introduction and Overview</title>
		<link>http://cs450.updatelog.org/2009/06/15/intro-slides/</link>
		<comments>http://cs450.updatelog.org/2009/06/15/intro-slides/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 23:59:38 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
		
		<category><![CDATA[Lectures]]></category>

		<guid isPermaLink="false">http://cs450.updatelog.org/?p=98</guid>
		<description><![CDATA[Download the first lecture (Introduction) slides here and second lecture (OS Overview) slides here.
]]></description>
			<content:encoded><![CDATA[<p>Download the first lecture (Introduction) slides <a href="http://updatelog.org/files/cs450-introduction.pdf" onclick="javascript:pageTracker._trackPageview('/downloads/files/cs450-introduction.pdf');">here</a> and second lecture (OS Overview) slides <a href="http://updatelog.org/files/cs450-os_overview.pdf" onclick="javascript:pageTracker._trackPageview('/downloads/files/cs450-os_overview.pdf');">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://cs450.updatelog.org/2009/06/15/intro-slides/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
