RSS Forums RSS
Please support our C advertiser: Programming Forums

Today Question

Join Date: Jul 2004
Posts: 1
Reputation: jenyin84 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
jenyin84 jenyin84 is offline Offline
Newbie Poster

Today Question

  #1  
Jul 22nd, 2004
1. (a) What is trashing and list possible causes of thrashing.

(b) How does the operating system detect thrashing and what can it do to eliminate thrashing?

[15 marks]

2. The given program simulates the effect of changing page sizes in a demand paging system. The following sequence of request is taken from 460-word program: 10, 11, 104, 170, 73, 309, 185, 245, 246, 434, 458, 364.

Main memory can hold total of 200 words for this program and the page frame size will match the size of pages into which the program has been divided. The page numbers are calculated according to the page size; divide by the page size, and the quotient gives the page number. The number of page frames in memory is the total number, 200, divided by page size.

(a)
(i) What does function int find_page_in_memory(int page, Memory * memory) do?

(ii) Which memory allocation scheme is used in the program? Explain how it is implemented.

(iii) What is the use of struct in the program?

(b)
(i) Add some code in the program to find the success frequency or the percentage of successful request hit?

(ii) Find the success frequency for 100-words, 50-words, and 200-words. What conclusion can you make?

(iii) What do you think will happen if more memory were given to the program?

[45 marks]


3.
(a) Modify the program so that it uses the Least Recently Used page replacement algorithm.

(b) Find the success frequency of the new algorithm by repeating question 2 (b) (ii).

(c) Compare the results of the two algorithms.

(d) Assuming that you are developing a new operating system (for the present days applications), what type of memory allocation scheme you would use and why? Note: Marks will be awarded based on your creativity and suggestions (which should be beyond your text books).

[40 marks]
Attached Files
File Type: cpp assign1-prog.cpp (2.6 KB, 30 views)
AddThis Social Bookmark Button
 
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 5:59 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC