4 Pages

hw2

Course: CS 416, Fall 2009
School: Rutgers
Rating:
 
 
 
 
 

Word Count: 1390

Document Preview

Solutions HW#2 Problem 1 The "degree of multiprogramming" is the maximum number of processes that may be supported by a uniprocessor at any given time. Discuss some factors that must be considered in determining the degree of multiprogramming for a particular system. The number of resources that are available, ie the number of actively waiting processes. Size of your Main Memory will controll how...

Register Now

Unformatted Document Excerpt

Coursehero >> New Jersey >> Rutgers >> CS 416

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
Solutions HW#2 Problem 1 The "degree of multiprogramming" is the maximum number of processes that may be supported by a uniprocessor at any given time. Discuss some factors that must be considered in determining the degree of multiprogramming for a particular system. The number of resources that are available, ie the number of actively waiting processes. Size of your Main Memory will controll how many process you can keep in quick mem. Ulimatly it will be how your processes are scheduled and how the resources are used, so a good long-term, mid-term and short-term scheduler will control the degree of multiprogramming that your system will provide. Problem 2 When is a batch processing the preferred strategy for work to be done by the computer? When is timesharing the preferred strategy? Batch. Jobs with similar needs are batched together and run through the computer as a group by an operator or automatic job sequencer. Performance is increased by attempting to keep CPU and I/O devices busy at all times through buffering, off-line operation, spooling, and multiprogramming. Batch is good for executing large jobs that need little interaction; it can be submitted and picked up later. Time sharing. This systems uses CPU scheduling and multiprogramming to provide economical interactive use of a system. The CPU switches rapidly from one user to another. Instead of having a job defined by spooled card images, each program reads its next control card from the terminal, and output is normally printed immediately to the screen. Problem 3 Below is a list of fields from a classic process control block. In a modern process model with threads and processes, say whether each field should be implemented in the process or thread control block. a.User name - PCB - all like threads have same UID, no need to replicate in all threads. b.Stack bottom TCB each thread has it's own stack bottom c.Resources blocking me TCB in User-level threads it doesn't really matter, you will block anyway. But in Kernel level threads, each thread could be blocking on different resources. d.Primary memory allocated to me PCB each process needs to know the memory that it has and can then divide that among the threads. e.Files allocated to me TCB each thread may open it's own files f.Execution state TCB each thread has it's own PC register and it's own execution state. Problem 4 When a new process moves from the ready state to the running state, each register in the CPU must be set either to initial values or to the values the process had when it was last interrupted. Explain why the PC register is typically the last register loaded for the new process. PC (program counter) points to the next instruction to be executed. If you replace this with another value before saving all the other registers and loading in all new registers, then you begin to execute the instruction of the newly loaded PC register before you have stored and loaded all state of the CPU. Problem 5 Explain why all thread in a processes block when one of the thread blocks in a user space thread implementation. Why is this not the case in a kernel thread implementation? User-level threads are viewed by the kernel as one process, all the thread managament is done by the user. Since when a typical one thread process blocks on IO, it would be waiting for the IO to return, it is better to switch that process out of the CPU and let another process make some progress. In ULT this is not true, we could simply set another thread from that process into the CPU and it could make progress, but since the kernel views that process and a single threaded process, it puts the entire process on the blocked/waiting queue and waits for the IO to return before moving it back onto the ready queue. Problem 6 What are the differences between a trap and an interrupt? What is the use of each function? Answer: An interrupt is a hardware-generated change-of-flow within the system. An interrupt handler is summoned to deal with the cause of the interrupt; control is then returned to the interrupted context instruction. and A trap is a software-generated interrupt. An interrupt can be used to signal the completion of an I/O to obviate the need for device polling. A trap can be used to call operating system routines or to catch arithmetic errors. Problem 7 MS-DOS provided no means of concurrent processing. Discuss three major complications that concurrent processing adds to an operating system. Answer: 1._ A method of time sharing must be implemented to allow each of several processes to have access to the system. This method involves the preemption of processes that do not voluntarily give up the CPU (by using a system call, for instance) and the kernel being reentrant (so more than one process may be executing kernel code concurrently). 2.Processes and system resources must have protections and must be protected from each other. Any given process must be limited in the amount of memory it can use and the operations it can perform on devices like disks. 3.Care must be taken in the kernel to prevent deadlocks between processes, so processes aren't waiting for each other's allocated resources. Problem 8 Describe the actions a kernel takes to context switch between processes. Answer: In general, the operating system must save the state of the currently running process and restore the state of the process scheduled to be run next. Saving the state of a process typically includes the values of all the CPU registers in addition to memory allocation. Context switches must also perform many architecture-specific operations, including flushing data and instruction caches. Problem 9 Protecting the operating system is crucial to ensuring that the computer system operates correctly. Provision of this protection is the reason for dual-mode operation, memory protection, and the timer. To allow maximum flexibility, however, you should also place minimal constraints on the user. The following is a list of instructions that are normally protected. What is the minimal set of instructions that must be protected? a. Change to user mode. b. Read the clock. c. Turn off interrupts. d. Change to monitor mode. e. Read from monitor memory. f. Set value of timer. g. Write into monitor memory. Answer: The minimal set of instructions that must be protected are: a. Change to monitor mode. b. Read from monitor memory. c. Write into monitor memory. d. Turn off interrupt. e. Set value of timer Problem 10 Suppose you are asked to develop an OS for a personal computer with an expected market life of 5 years. What might be the relative importance of the following requirements? a. c. Performance Correctness b. Protection and security d. Maintainability e. f. Commercial factors Standards and Open systems Which of these requirements would be different for an operating system for a large mainframe with a market life of 20 years 5 year PC a Little importance, most people don't push there systems very hard and good hardware can mask bad performance. b Very important in the day of the internet. c It is only around for 5 years, as long as it works, does it matter how correct it is? Not really. d It is only around for 5 years, it doesn't matter if we can maintain a system like that. e Look at windows, this is huge. f Look at windows, not a big deal. But look at linux, open source has made it what it is. As for standards, this is always important when developing software, and a system is only as good as the things that people want to run on it. 10 year MF a Very important, mainframes compute huge amounts of data, the more you can squeeze out the better. b Not as important, assuming you aren't connected to the WAN and you trust the people who are using it. c Important, you can't expect people to be debugging your problems for the next 20 years. d Important, need to keep it running for 20 years, new hardware, new software, etc. e You are only selling a few of these to people who already know they need them, so commercial factor is not as big here. f This is important if you want the mainframe to be easily maintainable for the next 20 years.
Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

Rutgers - CS - 352
import java.io.*;import java.net.*;public class Client{public static void main(String[] args){/loop until you leave a line blank.while(true){/ Create a socket to communicate to the specified host and portSocket s = null;try{
Rutgers - CS - 352
import java.io.*;import java.net.*;public class Server{public static void main(String[] args){ServerSocket listen_socket = null;/Create the listening Socket. /Notice the cast of the String to an Integer, ServerSocket requires the po
Rutgers - CS - 205
Oeters 1 1Gary Oeters CS205 Discrete Structures Section 7 Stephen Max 3/10/2003 Project I In this project, I will determine for which directions four implications of predicate logic hold true. In other words, the goal of the assignment is to deter
Rutgers - CS - 352
PROJECT 1 Use Ethereal to debug & figure out the Bittorent protocol o Install Ethereal at your machine o Run Ethereal to capture packets. o Run a Bittorent client at your machine and try to download the file corresponding the project1.torrent o Lear
Rutgers - CS - 417
Distributed Bank Implementation=Design and implement the client and server code for a simple, distributed banking servicethat permits multiple concurrent operations while providing ACID semantics to the clients.The banking service will be able t
Rutgers - CS - 416
Program Structure- header files, source files. .h .c- .c and .h files can #include .h filesPreprocessor and conditional compilation#include"a.h"look in current directory first, then /usr/include#include<a.h>look in /usr/include first- ma
Rutgers - CS - 442
Summary of GDB commands for x86-64 Systems Command EffectStarting and stopping quit Exit gdb run Run your program run <command line args> Run your program using the specific c
Rutgers - CS - 170
Do Loop=do{put here the statements you want to loop on(they will be executed at least once)}while(condition)Example:=var a;do{a = confirm("Repeat?");} while(a =true)
Rutgers - CS - 519
Protection and SecurityCS 519: Operating System Theory Computer Science, Rutgers University Instructor: Thu D. Nguyen TA: Xiaoyan Li Spring 2002ProtectionWe have talked briefly about protection in the context of file management Main concepts: Acc
Rutgers - CS - 519
C S duling PU cheC 519: Ope S rating S mThe yste ory C pute S nce Rutge Unive om r cie , rs rsity I nstructor: Thu D. Nguye n TA: Xiaoyan Li S pring 2002What and Why?What is proce sche ssor duling? Why? At first to sharean e nsivere xpe source m
Rutgers - CS - 519
Processes, Threads, SynchronizationCS 519: Operating System Theory Computer Science, Rutgers University Instructor: Thu D. Nguyen TA: Xiaoyan Li Spring 2002Von Neuman ModelBoth text (program) and data reside in memory Execution cycle Fetch instru
Rutgers - CS - 519
CS 519: Lecture 2 Processes, Threads, and SynchronizationAssignment 1 Design and implement a threads package (details left out on purpose!) Check the Web page and the newsgroup for further details Groups of 3 students. Anybody still looking f
Rutgers - CS - 519
C m om unication in Tightly C ouple S te s d ys mC 519: Ope S rating S mThe yste ory C pute S nce Rutge Unive om r cie , rs rsity Instructor: Thu D. Nguye n TA: Xiaoyan Li S pring 2002Why Paralle Com l puting? Pe rform ! anceComputer Science, R
Rutgers - CS - 519
C 519: Le S cture9 Distribute FileS m d yste sFileS rvice e I m m nte by a use rne proce calle filese r ple e d r/ke l ss d rve A syste m haveoneor se ral filese rs running at thesam tim m ay ve rve e e Two m ls for filese s ode rvice upload/
Rutgers - E - 553
Digital libraries: Economic issuesTefko Saracevic, PhD 2008 Tefko Saracevic1ToC A few definitions & generalities Value of digital libraries Changing economic models Licensing Library consortia Open access Some economic data on digital
Rutgers - E - 553
Di gi ti zati onfr om physi cal to di gi tal worl ds Tefko Sar acevi c1Di gi ti zati on i s not just a pr ocess, but deci si ons, deci si ons, deci si ons r el ated among other s to sel ecti on standar ds best pr acti ces technol ogy and $ $ $
Rutgers - E - 553
Research in digital librariesAs done from human and technological perspectivesTefko Saracevic, PhD 2008 Tefko 1ToC Research orientations Emphasis in DL research Human-oriented DL research Technology-oriented DL research & development (R
Rutgers - E - 553
Keeping up"Knowledge is of two kinds. We know a subject ourselves, or we know where we can find information upon it."Samuel Johnson (1709-1784) Te S fko arace vic1But what whe wedo not know whe to find it?* * n re And westill want inform ati
Rutgers - E - 553
DI GI TAL LI BRARI ESCourse overviewtefko@scils.rutgers.edu [17:610:553] Online version e553Tefko Saracevic Tefko Saracevic1ToC of this overview First a few mechanics Then description of the course more or less as found in the
Rutgers - E - 530
Guide to exercise 2Brief examples Tefko Saracevic1 Objectives Using fields and different operators Explore federated searching on Dialog called OneSearch Here we will give limited examples the rest is in
Rutgers - E - 530
Principles of Searching syllabus 1Department of Library and Information Science School of Communication, Information and Library Studies Rutgers, The State University of New JerseyPRINCIPLES OF SEARCHING [17:610:530]Online version e530 3 c
Rutgers - E - 530
Principles of Searching e530 ASSIGNMENT FOR UNIT 1 Title Why? Overview of searching and a bit of history Online searching goes back decades. In the late 1960s National Library of Medicine was the first to offer online access to its system called Medl
Rutgers - E - 530
Principles of Searching e530 Term project: selection (first of three actions due on Mon. Feb. 23, 2009) Title Why? Selection of the topic for term project A term project is large, independent and termlong. The purpose of the project is for student
Rutgers - E - 553
Department of Library and Information Science School of Communication, Information and Library Studies Rutgers, The State University of New JerseyDIGITAL LIBRARIES[17:610:553] Online version - e553 3 credits SyllabusTefko Saracevic, PhD Profess
Rutgers - E - 530
PRINCIPLES OF SEARCHING [17:610:530 ] online e530 Tefko Saracevic Schedule for Spring 2009 Rutgers Spring 2009 calendar for graduate students: first day of classes Tue, Jan. 20; last day Mon May 11; Spring break March 14- 22. Week of Spring 2009 Jan
Rutgers - E - 553
Digital Libraries -e553 EXERCISE FOR UNIT 07 Title Why? Digitization Within the framework of unit Digitization, the aim is similar to the previous exercise, namely, to get some practical experiences in digitization and to get you advancing in creatio
Rutgers - E - 553
Digital Libraries e553 EXERCISE FOR UNIT 12 Title Why? Digital libraries: Economic issues Economic issues are not only important, but even critical for digital libraries. Through lecture, assignment and discussions we addressed a number of economic
Rutgers - E - 553
DIGITAL LIBRARIES [17:610:553 ] online e553 Tefko Saracevic Schedule for Spring 2009 Rutgers Spring 2009 calendar for graduate students: first day of classes Tue, Jan. 20; last day Mon May 11; Spring break March 14- 22. Week of Spring 2009 Jan 20 Jan
Rutgers - E - 553
Digital Libraries e553 EXERCISE FOR UNIT 02 Title Why? What is a digital library? a continuation of Exercise 01 The objective is the same, but we are concentrating here on different types o digital libraries. Objective of this exercise is to start
Rutgers - E - 530
Principles of Searching [17:610:530]OUTLINE FOR UNIT 4 Title Why? Information retrieval (IR); interaction in IR Every online database, every search engine, everything that is searched online is based in some way or another on principles developed
Rutgers - E - 553
Digital Libraries -e553 ASSIGNMENT FOR UNIT 12 Title Why? Digital libraries: Economic issues The hand of economics rules digital libraries, sometimes visibly other times invisibly. But it is always there. Libraries, publishers and other stakeholders
Rutgers - E - 553
Digital Libraries e553 ASSIGNEMENT FOR UNIT 03 Title Why? Keeping up As Samuel Johnson said: "Knowledge is of two kinds. We know a subject ourselves, or we know where we can find information upon it." vigorous mind."He also said: "Curiosity is one
Rutgers - ITI - 230
Understanding and conceptualizing interaction Recap HCI has moved beyond designing interfaces for desktop machines About extending and supporting all manner of human activities in all manner of places Facilitating user experiences through de
Rutgers - LIS - 553
The Dot-Com Boom"Content is King"Actually comes from the cable TV business, although attributed to Esther Dyson who believed the opposite. The meaning was that what mattered about a website, or an online service, was the available content; this ma
Rutgers - LIS - 558
SearchingMechanical: Linear Sorting Hashing Logical Boolean Best match Intellectual: Strings Fields ConceptsFrom keys to documentsThe mechanical problem: given a set of words (or other things to look for) appearing in a set of documents, how to
Rutgers - LIS - 556
Theft Prevention in LibrariesAmerican Libraries named theft a top priority problem for 2005.Research on the topic?Almost nothing.Why isn't more done?Psychology: Thought that admitting you've been robbed makes you an easy target Cases in poin
Rutgers - LIS - 535
WargamingSimulation methods: pretend you're in the new business, and try to imagine what your competitors might do. Fully automated: SimCity, with business modeling software instead of teenage games. Manual: groups of people role-playing. Value: let
Rutgers - LIS - 582
Government informationWhat is the digital equivalent of the "depository library"? Who should publish government information? How far should FOIA extend? How do we balance security, privacy, and information? (I didn't think this lecture was going to
Rutgers - LIS - 553
International Digital LibrariesUsually fairly routine digitization. Normally designed to show off either the holdings of the library or the local culture or language. Relatively little cooperation. Sometimes material in English; rarely in others.N
Rutgers - LIS - 553
Paying for digital librariesWhy is this hard? New services, but no new money Cost of transition Users not in the community A problem of quantization: Sell by item or sell in bulk? Sell to one reader or to many? Should research be available free?
Rutgers - LIS - 535
ProductsWhat is a possible new product? Same thing cheaper: offshore, new design, new marketing or delivery. Same thing for a new audience: helping the novice tennis player or golfer. Creating some kind of new group or society: coffee bars, team jac
Rutgers - LIS - 558
Digital Rights ManagementTechnologies to protect copyrighted content 1. Broken media 2. Bulk 3. Testing for the printed manual 4. Dongles 5. Flickering 6. Activation/serial number 7. Watermarking 8. Cryptography 9. PalladiumBroken media: the 1980s
Rutgers - LIS - 558
Digital library packagesGreenstone Fedora D-space Open source, internationalism, and courseware. Overall message: only write code if you like it.GreenstoneFrom the University of Waikato, New Zealand. See How to Build a Digital Library by Witten &
Rutgers - LIS - 553
SIZE MATTERS: WEB AND BOOK ARCHIVINGMichael Lesk Internet Archive 116 Sheridan Avenue San Francisco, CA 94129 USA lesk@acm.org www.lesk.comIs it better for a library to be carefully selected or large? Traditionally libraries have prided themselves
Rutgers - LIS - 556
The Cheshire Cat John TennielThis is the back cover. This layout is for a book which is printed on 8.5x11 paper, and so needs a cover on 11x17. You should leave a fairly large margin since you'll have to trim each page by enough to make room for th
Rutgers - LIS - 558
Scientific databasesIncreasing access to raw data Requires more care to administer and to use But it's transforming science by providing data in advanceNot clear whether such databases end up in libraries or in the academic departments where the d
Rutgers - CS - 533
# Refinder3.txt# to change field divider from / to _ in Genia 3.0 POS file# and add _SYM tag to =open(INPUT,"GENIA3_0_pos.txt");open(OUTPUT,">genia30pos4.txt");@lines = <INPUT>;$n=0;while ($lines[$n]) { $_ = $lines[$n]; s/(.*)
Rutgers - MLIS - 512
Heuristic Evaluation (using Nielsen's heuristics) InstructionsPerform a heuristic evaluation of the system assigned. A heuristic evaluation is an informal expert evaluation technique that relies on a series of `heuristics.' The intent is to determin
Rutgers - ITI - 230
Simple experiment Try it yourself. (do not "cheat") when the next slide comes up as fast as you can Start saying colors (not the words) you see in list of words Say "done" when finished Use timer to time yourself.MLIS 512 Interface Design
Rutgers - ITI - 230
04:547:230(01) (Index: 10636) ITI 230 HCI Lecture #12"Use of Color in Design Bonus Slides"Dr. Jacek Gwizdkahttp:/www.scils.rutgers.edu/~jacekg/teaching/Bonus Strange perceptual effects and visual "tricks" There are many, many ways to
Rutgers - ITI - 230
Cognitive WalkthroughMLIS 512 Interface Design Jacek Gwizdka1The 3 Questions1. 1.Will the correct action be sufficiently evident to the user?i.e.: Will the user know what to do to achieve the task?Will the user notice that the correc
Rutgers - ITI - 230
HCI Course Review Guide (ITI 230: Fall 2008 November 17, 2008) 1. Fundamentals of HCI and UserCentered Design (UCD)1.1. Basic conceptsMost important: the "philosophy" UserCentered Design Textbook Chapter 1 Week 1: HCI? UCD? Interactio
Rutgers - ITI - 230
Restaurant FinderBy Name By Category Breakfast Chinese Japanese Mexican Pizza & Sandwiches Seafood Show AllClick on restaurant to see the menuPizza & SandwichesRestautantGiovanneli's The Hang Out La Familia Neubies Brunswick Pizza Paulie's Pizz
Rutgers - ITI - 230
Prototype: _B_Step #Task Name: _View Bus Schedule_Will the user notice (visibility) that Will the correct action be the correct action is available? sufficiently evident to the user? Will the user see how to do it? Will the user know what to do?
Rutgers - MLIS - 550
17:610:550(2)Information Technologies for Libraries & Information AgenciesFall 2005 (JG)Lab 5: Database Software Use of Microsoft Access.This exercise intends to help you get familiar with basic MS Access functionality (tables & forms). Tasks: 1
Rutgers - CS - 515
CS515, Fall 2005, October 25, 2005A Note about DCG Grammar rules (in our tokenizer)This note is to further explain how our scanner (i.e., tokenizer)works in the Prolog project. What we are using is called a DefiniteClause Grammar to express Pro
Rutgers - CS - 352
CS 352- Network SecurityWhy Network Security? Malicious people share your network Same motivations as traditional world:Peepers, vandals, graffiti-artists, joy riders, thieves, burglars, blackmailers.Problem made more severe the more the
Rutgers - CS - 352
CS352- Link LayerDept. of Computer Science Rutgers UniversityContent Errordetection and correction MAC sub-layer Ethernet Token RingCS352 Fall,20052Error Detection and CorrectionError Detection and Correction Usedon many link ty
Rutgers - CS - 352
Link LayerMidterm 2 topics UDP TCP: Connection establishment Timer computation Slow start Fast recovery/Transmit Self clocking Additive increase/Multiplicative decrease IP Classbased routing CIDR Address forwarding decision rule2
Rutgers - CS - 352
CS 352Network LayerDept. of Computer Science Rutgers UniversityChapter 4: Network Layer 4. 1 Introduction 4.2 Virtual circuit and datagram networks 4.3 What's inside a router 4.4 IP: Internet Protocol 4.5 Routing algorithms Link
Rutgers - CS - 352
Introduction to Queuing TheoryQueuing theory definitions (Bose) "the basic phenomenon of queueing arises whenever a shared facility needs to be accessed for service by a large number of jobs or customers." (Wolff) "The primary tool for studyin