CS FundamentalsModerateGATE CS · Amazon/Microsoft SDE MCQ

Three users run the same 60 KB editor (pure, reentrant code) and each has 20 KB of private data. With paging that lets the code pages be shared, how much memory do the three need, versus without sharing?

  1. A. 120 KB versus 240 KB
  2. B. 140 KB versus 240 KB
  3. C. 80 KB versus 240 KB
  4. D. 120 KB versus 180 KB

Correct answer: A. 120 KB versus 240 KB

Shared: one copy of the code plus three data areas, 60 + 3 × 20 = 120 KB. Without sharing each user has 80 KB: 240 KB. Sharing needs the code to be read-only, i.e. reentrant.

More Operating Systems questions

Exams that ask this topic