Sei sulla pagina 1di 2

The exam will be given on January 4 th Saturday at 15:00-17:00 hours.

The venue will be announced later.

The exam duration will be 110 minutes.

The exam will cover all 12 chapters of your textbook.

No credit will be given to answers in Turkish.

You may need a “scientific calculator” for computations. No cellular phones will be allowed for
computations.

Exam will consist of following types of question.

SHORT ASSAY TYPE QUESTIONS (3 points each, 13 questions)

Explain the major problem solved by the introduction of paging mechanism.

ANSWER

Paging is a solution to process memory allocation problem. In particular, it solves the “external
fragmentation” problem that arises in contiguous allocation in the form of scattered memory holes
that amount to a considerable memory size.

LONG ASSAY TYPE QUESTIONS (6 points each, 3 questions)

Explain how “working set” approach reduces page fault rate.

ANSWER

For a particular process, if the OS can forecast the pages that will be used in near future, the page
fault rate of that process reduces. This is clearly seen in the page replacement strategy of “replace
the page that will not be used longest period of time”. Even though the OS has no way of precisely
forecasting the future, it still can do something. Working set model involves introduction of a
“working set window” such that the page references made within this window identify the “working
set” which is a collection of pages. Working set size may vary with time. Therefore, the number of
frames allocated to a process is a dynamic quantity and pages not existing in the working set can be
replaced thereby providing efficient use of memory. “Thrashing” which happens to a phenomenum
of blocking of a process due to continuous page fault is also prevented by this approach.

COMPUTATIONAL TYPE QUESTION (9 points each, 3 questions)

Assume we have a demand-paged memory. The page table is held in registers. It takes 8 milliseconds
to service a page fault if an empty page is available or the replaced page is not modified, and 20
milliseconds if the replaced page is modified. Memory access time is 100 nanoseconds.
Assume that the page to be replaced is modified 70 percent of the time. What is the maximum
acceptable page-fault rate for an effective access time of no more than 200 nanoseconds?

ANSWER

0.2 μsec = (1 − P) × 0.1 μsec + (0.3P) × 8 millisec + (0.7P) × 20 millisec


0.1 = −0.1P + 2400 P + 14000 P
0.1 ≃ 16,400 P
P ≃ 0.000006

PROGRAMMING TYPE QUESTION (16 points, 1 question)

Write a C code to implement “Buddy System Allocation”.

Potrebbero piacerti anche