3 Pages

Review 3 - Solutions

Course: COSC 4330, Summer 2012
School: U. Houston
Rating:
 
 
 
 
 

Word Count: 1166

Document Preview

4330/6310Fundamentals COSC of Operating Systems SOLUTIONS TO THE PROBLEMS DISCUSSED IN THE THIRD REVIEW SESSION Please try first to answer the questions yourself using the handout without the solutions. 1. True or false: a) A process that acquires all its resources at the same time will never be involved in a deadlock True. (The hold-and-wait condition is denied.) b) We cannot prevent deadlocks in client/server...

Register Now

Unformatted Document Excerpt

Coursehero >> Texas >> U. Houston >> COSC 4330

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.
4330/6310Fundamentals COSC of Operating Systems SOLUTIONS TO THE PROBLEMS DISCUSSED IN THE THIRD REVIEW SESSION Please try first to answer the questions yourself using the handout without the solutions. 1. True or false: a) A process that acquires all its resources at the same time will never be involved in a deadlock True. (The hold-and-wait condition is denied.) b) We cannot prevent deadlocks in client/server systems. True. (We cannot prevent deadlocks and allow messages to flow from client to server and back.) c) External fragmentation is often the result of using very large page sizes. False. (Larger page sizes increase internal fragmentation but it rarely is an issue in virtual memory systems.) d) Global page replacement policies cannot handle real-time processes. True. (Real-time processes must keep all their pages in memory all the time, which can only be achieved by giving them a private partition containing all the pages they will ever need.) e) UNIX uses file-specific passwords to control access to files. False. (UNIX uses the file access control list to check which file access rights can be granted to a user process.) f) UNIX stores the name of a file in its i-node. False. (See next answer.) g) A UNIX file can have several names. True. (It can have as many names as there are directory entries pointing to it.) h) UNIX special file are not files. True. (They are physical devicesor POSIX named semaphores.) 2. When comparing the hit ratios of two translation look-aside buffers, which question should we ask first? Are TLB misses handled by the firmware or the OS? If TLB misses are handled by the firmware, the cost of a TLB miss is one extra memory reference. If TLB misses are handled by the OS, the cost of a TLB miss is two context switches. 3. What is the purpose of the dirty bit? The dirty bit tells whether a page has been modified since the last time it was brought into main memory. It is used whenever a page must be expelled from main memory. If its dirty bit is ON, the page must be saved on disk (swap area) before being removed from main memory. If its dirty bit is OFF, there already is an exact copy of the page on disk. 1 4. How does the BSD UNIX page replacement policy simulate a missing page-referenced bit? What is the main drawback of the technique? Whenever the hand of the clock encounters a page that has been recently used, it marks it INVALID instead of clearing its page-referenced bit. The main drawback of this approach is that an interrupt will occur the next time that page will be accessed. The cost of handling this interrupt will be roughly equal to two context switches. 5. Among the following page replacement policies: Local FIFO, LOCAL LRU, Global FIFO, Global LRU, Original Clock, Berkeley Clock, and Windows, which ones: a) Are the poorest performers? Local FIFO and Global FIFO b) Cannot be implemented at a reasonable cost? Local LRU and Global LRU c) Provide a decent performance and do not require any special hard ware support? Berkeley Clock and Windows (Mach would have qualified but was not in the list) d) Support real-time processes? Windows (older exams mention VMS) 6. A virtual memory system has a virtual address space of 4 Gigabytes and a page size of 4 Kilobytes. Each page table entry occupies 4 bytes. a) How many bits are used for the byte offset? Since 4K =2_12_, the byte offset will use _12_ bits. b) How many bits are used for page the number? Since 4G = 2_32_ we will have _32_-bit virtual addresses. Since the byte offset occupies _12_ of these _32_ bits, _20_ bits are left for the page number. c) What is the maximum number of page table entries in a page table? Address space/ Page size = 2_32_ / 2_12_ = 2 _20__ PTEs. d) What is the maximum size of a page table? Since each PTE occupies 4 bytes, the answer is4 x 2_20_= 2_22_ bytes = _4_ MB. 7. A 32-bit UNIX file system has 16 kilobyte pages and i-nodes with 15 block addresses. How many file bytes can be accessed a) Directly from the i-node? The _12_ first blocks that is _12 x 16 KB =_192 KB_. b) With one level of indirection? An indirect block can store _16KB_ / 4B =_4K_ block addresses. Hence we can access the next__4K x 16K = 64_MB of the file. c) With two levels of indirections? With two levels of indirection we should be able to access (2_14_ B / 4B)2 = 2_24_ blocks. Keeping in mind that the maximum file size is only __4_ GB, we will be able to access __4 GB 64 MB 192 KB_. d) With three levels of indirections? _None___ 2 8. Redo the same problem at home with a page size of 8KB. The answers are (a) 96 KB, (b) 16 MB, (c) 4 GB 16 MB 96 KB and (d) none. 9. Internal fragmentation is not a big problem in virtual memory systems. Is it always so in file systems? Give a hypothetical example to support your argument. Internal fragmentation can be a big problem whenever the disk partition contains many files than are much smaller than the block size. Consider for instance a partition where many files are smaller than 1 KB and the block size is 4KB. More than 75 percent of the space used by these files will be wasted. 10. Alice, Bob and Carol want to share a few files on a UNIX system while preventing other users to access these files. What should they do? They should ask their system administrator to create a group abc for the three of them. 11. Give examples of tickets and access controls lists in the UNIX file system. The file descriptor of an opened file acts as a ticket. The protection bits of a file constitute its access control list. 12. Give examples of what could happen if metadata updates are written to disk in the wrong order. How does the Fast File System avoid that? What is the main drawback of this approach? Whenever we create a new file, the block containing the new i-node must be written to disk before the block containing the directory entry pointing to that i-node. Otherwise, a crash happening after the directory block has been written to disk but before the block containing the new i-node has been written to disk would leave the file system in a state where a directory entry would point to an i-node that does not exist. The Fast File System avoids that by requiring all I/O operations involving metadata updates to be blocking. While this solution ensures that the updates will always reach the disk in the right order, it dramatically decreases the throughput of the file system. 13. What are the respective advantages of journaling file systems using (a) synchronous and (b) asynchronous log updates? Journaling file systems using synchronous log updates guarantee that no metadata data update will be lost when the system crashes. Journaling file systems using asynchronous log updates only guarantee that the file system will recover to a recent consistent state but are much faster (because they do much less physical I/Os). 3
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:

HCCS - COSC - 4330
COSC 4330Fundamentals of Operating SystemsPROBLEMS DISCUSSED IN THE SECOND REVIEW SESSIONSummer 20121. Find the single sentence that applies best to each property:(Hint: Several of the choices offered are plain wrong.)Main disadvantage of microkernel
UNSW - ACCT1501 - 1501
ACCT1501 2012 Sem1 Tutor Manual TG DQ 1.12, 1.16; Problems 1.7, 1.15, 1.25;DQ1.12 Accrual accounting includes the impact of transactions on the financial statements in thetime periods where revenues and expenses occur rather than when the cash is recei
UNSW - ACCT1501 - 1501
ACCT1501 S12012 W2 Tutorial QuestionsTutorial Questions: DQ 2.6, 2.10; Problems 2.7, 2.22, 2.27DQ2.6a.A balance sheet can indicate whether a company is financially sound by a comparison of theamount of finance raised by debt with the amount raised f
UNSW - ACCT1501 - 1501
ACCT1501 2012 Sem1 Tutorial Question Solution Week 4DQ3.3Revenues increase profit, and profit increases retained profits, which is a part of shareholdersequity. It is likely that revenues (sales) also increase an asset, such as cash, or accountsreceiv
UNSW - ACCT1501 - 1501
ACCT1501 2012 Sem1 Tutorial Question Solution Week 5DQ4. 14The main reason for not including human capital on the balance sheet is themeasurement problem. If we take the consulting firm, the problem is putting a dollarfigure on each staff member. Woul
UNSW - ACCT1501 - 1501
ACCT1501 2012 Sem1 Tutorial Question Solution Week 6DQ5.7Cash flow information is inadequate for the assessment of financial performance orfinancial position. To enable economic performance to be assessed more broadly it isnecessary to go beyond cash
UNSW - ACCT1501 - 1501
ACCT1501 2012 Sem1 Tutorial Question Solution Week 8Problem A5.31 (a)Opening balanceSalesSales24 81026 65353 561AnnaCashCashCashClosing balance105 024Opening balance32 432Anna opening balance: $24 81030 22023 35619 01632 432105 024(
UNSW - ACCT1501 - 1501
ACCT1501 2012 Sem1 Tutor ManualDQ 8.8FIFO, weighted average and LIFO are assumptions made about the order in which units ofinventory flow through the business. FIFO assumes that the first items acquired are the first onessold and, therefore any ending
UNSW - ACCT1501 - 1501
ACCT1501 2012 Sem1 Tutorial Question SolutionDiscussion Question 6.3The purpose served by the auditors report is to provide a competent and independent opinion on thefairness of the financial statements. It is not a guarantee but rather an opinion that
UNSW - ACCT1501 - 1501
ACCT1501 2012 Sem1 Tutorial Question SolutionDQ14.1The purpose of financial statement analysis is to use the financial statements to evaluate anenterprises financial performance and financial position.DQ14.3Before calculating ratios the following inf
UNSW - ACCT1501 - 1501
ACCT1501 2012 Sem1 Tutor Question SolutionProblem 16.7Question 1W. W. Phillips CompanyStatement of Cost of Goods ManufacturedFor the Year Ended December 31, 1998Direct materials:Beginning inventoryAdd: PurchasesMaterials availableLess: Ending in
UNSW - ACCT1501 - 1501
Week 13 Tutorial Question SolutionQ1: YCube LimitedYCube Ltd manufactures electronic games. In 2007, YCube sold 35,000 games at $40 each.Total costs amounted to $550,000, of which $200,000 were considered fixed.In 2008 the company is considering repla
University of Florida - STA - 4504
STA 4504/5503Sample questions for exam 2Courtesy of Alan Agresti1. True-False questions.(a)For General Social Survey data on Y = political ideology (categories liberal, moderate, conservative), X1 = gender (1 = female, 0 =male), and X2 = political p
University of Florida - STA - 4504
Chapter 1: Introduction1.1 Categorical Response DataMethods for response variable (a.k.a. outcome variable, dependentvariable) Y whose measurement scale is a set of categories.Explanatory variables (a.k.a. predictors, covariates, independentvariables
University of Florida - STA - 4504
Chapter 1: Introduction1.1 Categorical Response DataTwo Types of Categorical VariablesNominal: unordered categoriesOrdinal: ordered categoriesMethods for response variable (a.k.a. outcome variable, dependentvariable) Y whose measurement scale is a s
University of Florida - STA - 4504
Chapter 1: Introduction1.1 Categorical Response DataMethods for response variable (a.k.a. outcome variable, dependentvariable) Y whose measurement scale is a set of categories.Explanatory variables (a.k.a. predictors, covariates, independentvariables
University of Florida - STA - 4504
Chapter 1: Introduction1.1 Categorical Response DataMethods for response variable (a.k.a. outcome variable, dependentvariable) Y whose measurement scale is a set of categories.Explanatory variables (a.k.a. predictors, covariates, independentvariables
University of Florida - STA - 4504
STA 4504/5503Categorical Data AnalysisSpring 2012Course InformationTime and Location:Tues 8:30 10:25 a.m. (per. 23)Thur 9:35 10:25 a.m. (per. 3)100 Grin-Floyd Hall (FLO)Instructor: Dr. Brett PresnellOce: 225 FLOE-mail: presnell@stat.ufl.eduOce
University of Florida - STA - 4504
STA 4504/5503Categorical Data AnalysisSample Exam 1Spring 20111. Indicate whether each of the following is true (T) or false (F).(a)In 22 tables, statistical independence is equivalent to a population odds ratiovalue of = 1.0.(b)A British study r
University of Florida - STA - 4504
STA 4504/5503Categorical Data AnalysisSample Exam 1Spring 20111. Indicate whether each of the following is true (T) or false (F).(a)TIn 22 tables, statistical independence is equivalent to a population odds ratiovalue of = 1.0.(b)FA British stu
Alabama - ECON - 497
Alabama - ECON - 497
Alabama - ECON - 497
Alabama - ECON - 497
Alabama - ECON - 497
Alabama - ECON - 497
EC497/597: Games and DecisionsProblem Set 11Book Problems:Chapter 2: questions 3, 4, 6, 8Chapter 3: questions 2, 3, 4, 7Chapter 4: questions 1, 2(a), 3, 42Other Problems:1. Consider the game illustrated in below.(a) How many strategies does play
Alabama - ECON - 497
Alabama - ECON - 497
Alabama - ECON - 497
Alabama - ECON - 308
Alabama - ECON - 308
Econ 308 Problem Set #1: SolutionProblem 1 (Chapter 2: Varian Review Q1) Orginally the consumer facesthe budget line p1 x1 + p2 x2 = m. Then the price of good 1 doubles, the price ofgood 2 becomes 8 times larger, and income becomes 4 times larger. Writ
Alabama - ECON - 308
Econ 308 Problem Set #2: PreferencesProblem 1 (Chapter 3: Varian Review Q1) If we observe a consumerchoosing (x1 ; x2 ) when (y1 ; y2 ) is available one time, are we justied in concluding (x1 ; x2 ) (y1 ; y2 )?Answer: No. The consumer may be indierent
Alabama - ECON - 308
Econ 308 Problem Set #3: Math ReviewProblem 1 Calculate the partial derivatives for the following functions:1. F (x; y ) = 2 !@F@x2. F (x; y ) = 2x3 y !@F@y= 0,@F@x3. F (x; y ) = ln x + y !=0= 6x2 y ,@F@y= 2x3@F@x@F@y=11= x,4. F (x
Alabama - ECON - 308
Econ 308 Problem Set #4: SolutionsProblem 1 Calculate the marginal rate of substitution for the following utilityfunctions:1. u(x; y ) = 2x + y ! M RS =2. u(x; y ) = 2x3 y ! M RS =21=26x2 y2x31x3. u(x; y ) = ln x + y ! M RS =3yx=1x=14.
Alabama - ECON - 308
Alabama - ECON - 308
Alabama - ECON - 308
Alabama - ECON - 308
Alabama - ECON - 308
Econ 308 Review Midterm 2Problem Sets 7-11Market Demand Elasticity Relation of Revenue with ElasticityTechnology Production Function Isoquant MRTS Returns to scale Computing Returns to scale for Cobb-Douglass production.Cost Minimization Isoco
Alabama - CS - 150
CS 150Exam 3Marcus BrownRevision Date: June 27, 2011All tasks are all or nothing. There is no partial credit given for this test. Although the task points add upto more than 100, the maximum number of points you can receive is 100.You must put all y
Alabama - CS - 150
CS 150Exam ZeroRevision Date: May 2, 2012PreliminariesUnplug your network cable from your computer and place it so that its disconnected state can by ascertainedby the instructors as they walk by.This exam has a total of 100 points. All tasks are al
Alabama - CS - 150
CS 150Exam 0Revision Date: January 30, 2012All questions are all or nothing. There is no partial credit given for this test.Task 1: LinuxFirst create a directory named exams that hangs o your cs150 directory. O the exams directory, create adirectory
Alabama - CS - 150
CS 150Exam OneRevision Date: February 23, 2012Unplug your network cable from your computer. As best you can, place the end of the cable where it isreadily visible.This exam has a total of 100 points. Generally, there is no partial credit for a task.
Alabama - CS - 150
CS 150Exam 1Revision Date: June 9, 2011All tasks are all or nothing. There is no partial credit given for this test. Although the task points add up to more than 100,the maximum number of points you can receive is 100.You must put all your programs i
Alabama - CS - 150
CS 150Exam 1Revision Date: January 30, 2012All tasks are all or nothing. There is no partial credit given for this test. Although the task points add up to more thanpoints, the maximum number of points you can receive is 100.You must put all your pro
Alabama - CS - 150
CS 150Exam TwoRevision Date: March 22, 2012If you have not yet downloaded the scanner, do so now:wget beastie.cs.ua.edu/cs150/projects/scanner.pyUnplug your network cable from your computer. As best you can, place the end of the cable where it isrea
Alabama - CS - 150
CS 150Exam 2Revision Date: June 20, 2011All tasks are all or nothing. There is no partial credit given for this test.You must put all your programs in the correct directories and submit from the specied directory or you will receive zerocredit.Setup
Alabama - CS - 150
CS 150Exam 2Revision Date: January 30, 2012All tasks are all or nothing. There is no partial credit given for this test.You must put all your programs in the correct directories and submit from the specied directory or you will receive zerocredit.Se
Alabama - CS - 150
CS 150Exam ThreeRevision Date: April 12, 2012If you have not yet downloaded the scanner, do so now:wget beastie.cs.ua.edu/cs150/projects/scanner.pyUnplug your network cable from your computer. As best you can, place the end of the cable where it isr
Alabama - CS - 150
CS 150Exam 3Revision Date: January 30, 2012Subtasks are all or nothing. There is no partial credit given for this test.The maximum number of points you can receive is 100, even though there are additional questions.First, create a directory named thr
Alabama - CS - 150
CS 150Final ExamRevision Date: December 15, 2011Before unplugging your network cable, download this data le for the last question:wget beastie.cs.ua.edu/cs150/exams/dataUnplug your network cable from your computer. You may be asked to hold it up for