1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Marat540 [252]
4 years ago
7

Memory Question!

Engineering
1 answer:
mafiozo [28]4 years ago
7 0

Answer:

Demand Paging

The basic idea behind demand paging is that when a process is swapped in, its pages are not swapped in all at once. Rather they are swapped in only when the process needs them. ( on demand. ) This is termed a lazy swapper, although a pager is a more accurate term.

Figure 9.4 - Transfer of a paged memory to contiguous disk space

9.2.1 Basic Concepts

The basic idea behind paging is that when a process is swapped in, the pager only loads into memory those pages that it expects the process to need ( right away. )

Pages that are not loaded into memory are marked as invalid in the page table, using the invalid bit. ( The rest of the page table entry may either be blank or contain information about where to find the swapped-out page on the hard drive. )

If the process only ever accesses pages that are loaded in memory ( memory resident pages ), then the process runs exactly as if all the pages were loaded in to memory.

Figure 9.5 - Page table when some pages are not in main memory.

On the other hand, if a page is needed that was not originally loaded up, then a page fault trap is generated, which must be handled in a series of steps:

The memory address requested is first checked, to make sure it was a valid memory request.

If the reference was invalid, the process is terminated. Otherwise, the page must be paged in.

A free frame is located, possibly from a free-frame list.

A disk operation is scheduled to bring in the necessary page from disk. ( This will usually block the process on an I/O wait, allowing some other process to use the CPU in the meantime. )

When the I/O operation is complete, the process's page table is updated with the new frame number, and the invalid bit is changed to indicate that this is now a valid page reference.

The instruction that caused the page fault must now be restarted from the beginning, ( as soon as this process gets another turn on the CPU. )

Figure 9.6 - Steps in handling a page fault

In an extreme case, NO pages are swapped in for a process until they are requested by page faults. This is known as pure demand paging.

In theory each instruction could generate multiple page faults. In practice this is very rare, due to locality of reference, covered in section 9.6.1.

The hardware necessary to support virtual memory is the same as for paging and swapping: A page table and secondary memory. ( Swap space, whose allocation is discussed in chapter 12. )

A crucial part of the process is that the instruction must be restarted from scratch once the desired page has been made available in memory. For most simple instructions this is not a major difficulty. However there are some architectures that allow a single instruction to modify a fairly large block of data, ( which may span a page boundary ), and if some of the data gets modified before the page fault occurs, this could cause problems. One solution is to access both ends of the block before executing the instruction, guaranteeing that the necessary pages get paged in before the instruction begins.

9.2.2 Performance of Demand Paging

Obviously there is some slowdown and performance hit whenever a page fault occurs and the system has to go get it from memory, but just how big a hit is it exactly?

There are many steps that occur when servicing a page fault ( see book for full details ), and some of the steps are optional or variable. But just for the sake of discussion, suppose that a normal memory access requires 200 nanoseconds, and that servicing a page fault takes 8 milliseconds. ( 8,000,000 nanoseconds, or 40,000 times a normal memory access. ) With a page fault rate of p, ( on a scale from 0 to 1 ), the effective access time is now:

( 1 - p ) * ( 200 ) + p * 8000000

= 200 + 7,999,800 * p

which clearly depends heavily on p! Even if only one access in 1000 causes a page fault, the effective access time drops from 200 nanoseconds to 8.2 microseconds, a slowdown of a factor of 40 times. In order to keep the slowdown less than 10%, the page fault rate must be less than 0.0000025, or one in 399,990 accesses.

A subtlety is that swap space is faster to access than the regular file system, because it does not have to go through the whole directory structure. For this reason some systems will transfer an entire process from the file system to swap space before starting up the process, so that future paging all occurs from the ( relatively ) faster swap space.

Some systems use demand paging directly from the file system for binary code ( which never changes and hence does not have to be stored on a page operation ), and to reserve the swap space for data segments that must be stored. This approach is used by both Solaris and BSD Unix

You might be interested in
How can you use the IPDE Process to help protect motorcyclists while driving?
gladu [14]
Answer: you can use the IPDE process to protect motorcyclists while driving by identifying when a motorcycle is present, predicting what it will do next, deciding how to react to the other drivers decision, and exacting that decision.

I hope this helped
3 0
3 years ago
T he area of a circle is pr 2. Define r as 5, then find the area of a circle,using MATLAB®.(b) The surface area of a sphere is 4
aksik [14]

Answer:

Area of Circle = 78.5398

Surface Area of Sphere =  1.2566 x 10^3 = 1256.6 ft

Volume of Sphere =  33.5103 ft

Explanation:

Please find below the written MatLab script used to solve the problem. I had to define r in each case to solve for the Area of the circle, the surface area and the volume of the Sphere.

r=5; % define r as 5

a=pi*r^2;% calculate the area of the circle

AreaOfCircle=a

r=10; % define r and 10 ft

sa=4*pi*r^2; %Calculate the surface area of the sphere

SphereSurfaceArea=sa

r=2;% define r as 2 ft

vs=(4/3)*pi*r^3;% Calculate the volume of the sphere

VolumeShere=vs

3 0
3 years ago
Read 2 more answers
Help plsss fast!!!!!!
Semmy [17]

Answer:

1. Cast iron or aluminum

2. aluminum (first blank) iron(second blank)

3. aluminum

4. dry sleeve

5. Wet sleeve

6. matching operation that cuts a series of holes through the block for crankshaft bearing

8 0
3 years ago
How nany degrées is the included angle of General Purpose Acme threads? A. 60 B. 29 c. 14.5 D. 10
horrorfan [7]

Answer:

B.29

Explanation:

In general purpose acme thread:

  Nominal depth of thread=0.5ltimes Pitch

  Included angle =29 degrees

Generally Acme thread are following types

  1.General purpose(G) Acme

  2.Centralizing(C) Acme

  3. Stub Acme  

Centralizing(C) Acme threads have tighter tolerance during manufacturing as compare to General purpose(G) Acme  threads.

8 0
3 years ago
Coulomb's Law Two point charges experience an attractive force of 10.8 N when they are separated by 2.4 m. VWhat force in newton
SashulF [63]

Answer:

The force between the charges when the separation decreases to 0.7 meters equals 126.955 Newtons

Explanation:

We know that for two point charges of magnitude q_{1},q_{2} the magnitude of force between them is given by

F=\frac{k_{e}q_{1}\cdot q_{2}}{r^{2}}

where

k_{e} is constant

r is the separation between the charges

Initially when the charges are separated by 2.4 meters the force can be calculated as

F_{1}=\frac{k_{e}\cdot q_{1}q_{2}}{2.4^{2}}\\\\10.8=\frac{k_{e}\cdot q_{1}q_{2}}{2.4^{2}}\\\\\therefore k_{e}\cdot q_{1}q_{2}=10.8\times 2.4^{2}=62.208

Now when the separation is reduced to 0.7 meters the force is similarly calculated as

F_{2}=\frac{k_{e}\cdot q_{1}q_{2}}{0.7^{2}}

Applying value of the constant we get

F_{1}=\frac{62.208}{0.7^{2}}

Thus F_{2}=126.955Newtons

5 0
3 years ago
Other questions:
  • Anyone have any good ways of revisiting <br> Or <br> Have any good study notes
    11·1 answer
  • What is tcp in network?
    13·1 answer
  • Consider film condensation on a vertical plate. Will the heat flux be higher at the top or at the bottom of the plate? Why?
    5·1 answer
  • A 1.8-m3 rigid tank contains water steam at 220oC. One-third of the volume is in the liquid phase and the rest is in the vapor f
    14·1 answer
  • The annual average of solar photovoltaic energy in Phoenix is 6,720
    8·1 answer
  • At a certain section in a pipeline, a reducer is used to reduce the diameter from 2D gradually to diameter D. When an incompress
    12·1 answer
  • In addition to passing an ASE certification test, automotive technicians must have __________ year(s) of on the job training or
    15·1 answer
  • What should be given to a customer before doing a repair?
    9·1 answer
  • While discussing possible causes of black smoke from the exhaust of an older heavy-duty Diesel engine, technician a says that bl
    10·1 answer
  • Simplify the expression below:<br><br> 313 + 12 =
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!