User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C section within the Software Development category of DaniWeb, a massive community of 426,201 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,816 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C advertiser: Programming Forums
Views: 2292 | Replies: 5
Closed Thread
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
 
Join Date: Mar 2004
Posts: 1,514
Reputation: kc0arf is a jewel in the rough kc0arf is a jewel in the rough kc0arf is a jewel in the rough 
Rep Power: 10
Solved Threads: 49
Colleague
kc0arf kc0arf is offline Offline
Posting Virtuoso

Re: Today Question

  #2  
Jul 23rd, 2004
Hello,

We can't!

The idea of a community such as DaniWeb is for a group participation and learning by solving the problem. It is also unethical for A) us to do your homework, and B) for you to accept our work as your homwork. No! Your post also looks like a take-home exam. It is fortunate that your teacher/professor didn't put in contact information on the attachment, or someone who was really ethically motivated could have contacted him and caused you a lot of trouble.

What can we do?

You are the student. We can make suggestions to your code, and help correct it, but the guts of the code have to be yours. Spend an hour, and start with either a basic flow chart, or write down some psudeo-code (code that is not correct, but gets the idea) and we will build from there.

Anyone who just emails you the answer is not working with the spirit of learning, regardless of any impending deadlines.

We await your code submission...

Christian
 
Join Date: May 2004
Posts: 251
Reputation: FireNet will become famous soon enough FireNet will become famous soon enough 
Rep Power: 6
Solved Threads: 6
FireNet's Avatar
FireNet FireNet is offline Offline
Posting Whiz in Training

Re: Today Question

  #3  
Jul 23rd, 2004
Yea,we aint answering machines nor auto homework doers.We help out solving difficulties.

,Have fun(Btw by welcome)
See what you can, remember what you need

Fourzon | Earn via Coding
 
Join Date: Oct 2005
Posts: 1
Reputation: fiza is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
fiza fiza is offline Offline
Newbie Poster

Re: Today Question

  #4  
Oct 16th, 2005
thnks jenny for your questions, and for those who posted the solution, thank you very much, u help me a lot )
 
Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 11,174
Reputation: Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of 
Rep Power: 38
Solved Threads: 930
Moderator
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Most Valuable Poster

Re: Today Question

  #5  
Oct 16th, 2005
Originally Posted by fiza
thnks jenny for your questions, and for those who posted the solution, thank you very much, u help me a lot )

you forgot to use the [sarcastic] and [/sarcastic] tags :cheesy:
 
Join Date: Apr 2004
Posts: 3,628
Reputation: Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light 
Rep Power: 17
Solved Threads: 142
Colleague
Dave Sinkula's Avatar
Dave Sinkula Dave Sinkula is offline Offline
long time no c

Re: Today Question

  #6  
Oct 16th, 2005
Originally Posted by fiza
thnks jenny for your questions, and for those who posted the solution, thank you very much, u help me a lot )
Please don't resurrect dead threads.
 
Closed Thread

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb C Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the C Forum

All times are GMT -4. The time now is 7:04 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC