3i Infotech Placement: Sample Questions 759 - 760 of 1245

Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 759

Edit

Describe in Detail

Essay▾

Justify the use of virtual constructors in c ++ .

Explanation

  • Constructors are special functions for initializing of every object.
  • Compiler arranges to call the constructor whenever an object is created.
  • Constructors initialize object members after storage is allocated.
  • Constructor has same name as that of class, and constructors never have return type.
  • Constructors are defined either inside the class definition or outside class definition using class name and scope resolution:: operator.
Given the Image is Constructor Declaration and Definition
  • Constructors are of three types:
    • Default constructor
    • Parameterized constructor
    • Copy constructor

Question 760

Edit

Describe in Detail

Essay▾

What are demand-and pre-paging?

Explanation

Demand-Paging

Diagram of Demand Paging
  • The transfer of page from secondary memory to primary memory is upon need- that is “on demand” - page brought into memory when a location on page is referenced during execution.
  • Process begins execution with no page in physical memory- page faults accrue the process՚s working set in physical memory.

Advantages of bringing a page into memory only when needed:

  • Less I/O needed
  • Faster response
  • Support for more users
  • Loading pages of memory on demand lowers the memory footprint.
    • Memory footprint refers to amount of main memory that a program uses or reference while running.

Pre-Paging

Understanding of Pre-Paging
  • Tries to predict which page would be required next by the processor and brings that proactively into memory.
  • Assumes for example that process requests consecutive address and gets the next page when last address on this page is accessed. Actual prediction schemes might be more complicated.
  • Retrieval of a page other than demanded by a page fault hoping that additional page would be needed in future.

Advantages and Disadvantages of Pre-paging

  • If pre-paged page are unused , I/O and memory are wasted.
  • Good strategies to pre-page might however increase the performance by reducing expensive page faults.

Developed by: