Operating
systems exams - multiple choice questions (MCQ) and answers, Objective
type questions, OS exam questions, MCQ in memory management, process management, disk scheduling, process state transition, race condition
1. A computer system has a 36-bit virtual address space with a page size of 8K, and 4 bytes per page table entry. How many pages are in the virtual address space?
a) 8,192
b) 4,096
c) 68,71,94,76,736
d) 83,88,608
Answer: (d) 83,88,608 A 36 bit address can address 2^36 bytes in a byte addressable machine. Since the size of a page 8K bytes (2^13), the number of addressable pages is 2^36 / >2^13 = 2^23 = 83,88,608. |
2. Which is true about process termination?
a) The waitpid operation always blocks the calling process
b) A child process can kill another child process of the same parent process
c) A child process that exits before the parent process does a waitpid operation becomes a zombie process
d) None of the above
Answer: (d) None of the above Process termination is a technique in which a process is terminated and releases the CPU after completing the execution. It may happen in the following situations;normal conditions (exit() call), abnormal termination (due to programming error, runtime error, i/o error etc.), parent may terminate child process, due to memory requirement etc. |
3. In the process state transition diagram, the transition from the Ready state to the Running state:
a) Indicates that a process was preempted by another process
b) Indicates that a process is chosen by CPU for execution
c) Indicates that a process is done waiting for an I/O operation
d) Indicates that a process has blocked on an I/O operation
Answer: (b) Indicates that a process is chosen by CPU for execution Ready state - The task has completed preparations for running, but cannot run because a task with higher precedence is running. In this state, the task is able to run whenever it becomes the task with the highest precedence among the tasks in READY state. Running state - A process moves into the running state when it is chosen for execution. The process's instructions are executed by one of the CPUs (or cores) of the system. The transition from ready state to running state happens if the process is chosen for execution by the CPU. |
4. Disk scheduling algorithms attempt to reduce
a) Transfer time
b) Rotational latency
c) Seek time
d) All of the above
Answer: (c) Seek time In operating systems, seek time is very important. Since all device requests are linked in queues, the seek time is increased causing the system to slow down. Disk Scheduling Algorithms are used to reduce the total seek time of any request. Seek time – Seek time is the time taken for a hard disk controller to locate a specific piece of stored data. It measures the delay for the disk head to reach the track.Transfer time – It is about how long the actual data read or write takes. It is the time actually taken to transfer a span of data. Rotational latency - Rotational latency (or just latency) is the delay waiting for the rotation of the disk to bring the required disk sector under the read-write head. It accounts for the time to get to the right sector. |
5. Two threads in the same process share the same
a) Address space
b) Program counter
c) Stack
d) All of the above
Answer: (a) Address space In a multi-threaded process, all of the process’ threads share the same memory and open files. Within the shared memory, each thread gets its own stack. Each thread has its own instruction pointer and registers. Threads allow for efficient sharing of information, since the address space is shared, multiple threads can directly access the same memory. |
No comments:
Post a Comment