Friday, April 24, 2020

Operating systems multiple choice questions for exams - Set 14

Operating systems exams - multiple choice questions (MCQ) and answers



Operating Systems MCQ questions and answers – Set 14

1. Which among the following is referred as “the type of paging where a page is never rolled (or swapped) into memory unless needed”?
(a) Daemonized lazy paging
(b) Lazy paging daemon
(c) Lazy swapper
(d) Demand paging

View Answer

Answer: (c) Lazy swapper 

Define lazy swapper.

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. A "lazy swapper" in no way swaps a page into memory unnecessarily.

2. What is the purpose of dirty bit?

(a) Dynamic allocation of memory used by one process to another
(b) Implementing FIFO page replacement algorithm
(c) To reduce the average time required to service page faults
(d) None of the above

View Answer

Answer: (c) To reduce the average time required to service page faults     
Dirty bit is associated with each page in order to reduce the page fault service time. A page is considered dirty when the page is first written, ie., when the copy in memory does not match the version in disk. Dirty bit is set by hardware whenever the page is modified.

3. Which of the following is not able to solve race condition?

(a) Test and Set lock
(b) Monitor
(c) Semaphore
(d) Shared memory

View Answer

Answer: (d) Shared memory        

Define race condition

A race condition is a special condition that may occur inside a critical section. A race condition occurs when two or more threads can access shared data and they try to change it at the same time. To prevent race conditions from occurring you must make sure that the critical section is executed as an atomic instruction. That means that once a single thread is executing it, no other threads can execute it until the first thread has left the critical section.
Options (a) test and set lock, (b) Monitor and (c) Semaphore are used to solve race condition.

4. When a process is first launched, the operating system does not know the size ______ segment.

(a) Text
(b) Data
(c) BSS
(d) Heap

View Answer

Answer: (d) Heap        
The heap is an area of dynamically-allocated memory that is managed automatically by the operating system or the memory manager library. Memory on the heap is allocated, de-allocated, and resized regularly during program execution.
When a process is first launched, the OS does not know the size of heap due to the reason that OS does not know how much memory required. The size of the heap is set on application startup, but can grow as space is needed (the allocator requests more memory from the operating system)

5. What information is stored in a thread control block (TCB)?

(a) List of open files.
(b) Stack pointer.
(c) Memory map.
(d) Thread owner ID

View Answer

Answer: (b) Heap memory and (d) Stack memory      

Thread control block stores stack pointer.

TCB also stores the following;
  • Thread ID: It is a unique identifier assigned by the Operating System to the thread when it is being created.
  • Thread states: These are the states of the thread which changes as the thread progresses through the system
  • CPU information: It includes everything that the OS needs to know about, such as how far the thread has progressed and what data is being used.
  • Thread Priority: It indicates the weight (or priority) of the thread over other threads which helps the thread scheduler to determine which thread should be selected next from the READY queue.

No comments:

Post a Comment

Featured Content

Multiple choice questions in Natural Language Processing Home

MCQ in Natural Language Processing, Quiz questions with answers in NLP, Top interview questions in NLP with answers Multiple Choice Que...

All time most popular contents