Unit I: Introduction to Operating System | Process Management
What is the primary function of an operating system?
A. Running applications
B. Managing hardware resources
C. Providing user interfaces
D. Storing data
Answer: B. Managing hardware resources
Explanation: The primary function of an operating system is to manage hardware resources such as the CPU, memory, and I/O devices, enabling efficient and fair resource allocation among applications.In computer organization, what is the purpose of the Supervisor Mode in an operating system?
A. Executes user programs
B. Manages system resources
C. Provides a user interface
D. Handles I/O operations
Answer: B. Manages system resources
Explanation: Supervisor Mode allows the operating system to execute privileged instructions to manage hardware resources and maintain overall system stability and security.Which operating system follows a multi-user, multi-tasking model and was developed at Bell Labs in the 1970s?
A. Windows
B. UNIX
C. MacOS
D. Linux
Answer: B. UNIX
Explanation: UNIX was developed at Bell Labs in the 1970s and is known for its multi-user, multi-tasking capabilities, making it a foundation for many modern operating systems.What is the key characteristic that distinguishes Supervisor Mode from User Mode?
A. Speed of execution
B. Access to privileged instructions
C. User interface design
D. Memory management
Answer: B. Access to privileged instructions
Explanation: Supervisor Mode has access to privileged instructions that are restricted in User Mode, ensuring system security and preventing accidental or malicious hardware misuse.What does PCB stand for in the context of process management?
A. Process Control Block
B. Program Code Buffer
C. Processor Control Byte
D. Peripheral Control Bus
Answer: A. Process Control Block
Explanation: The Process Control Block (PCB) is a data structure used by the operating system to store information about a process, including its state, program counter, and resource usage.
Which of the following is an example of an independent process?
A. Two threads sharing the same data
B. A parent process and its child process
C. Two processes that do not share resources
D. A process waiting for an I/O operation to complete
Answer: C. Two processes that do not share resources
Explanation: Independent processes operate without any dependency or interaction, meaning they do not share data or resources.What is the purpose of Inter-Process Communication (IPC) in an operating system?
A. Managing process states
B. Allowing processes to communicate and share data
C. Allocating memory to processes
D. Controlling access to hardware resources
Answer: B. Allowing processes to communicate and share data
Explanation: IPC mechanisms enable processes to communicate and share information, which is essential for coordination in multi-process environments.In the context of process states, what is the state of a process that is ready to execute but waiting for the CPU?
A. Running
B. Blocked
C. Ready
D. New
Answer: C. Ready
Explanation: A process in the "Ready" state is prepared for execution but is waiting for the CPU to become available.What operation on processes involves temporarily suspending a currently executing process and saving its state?
A. Blocking
B. Preemption
C. Swapping
D. Forking
Answer: B. Preemption
Explanation: Preemption occurs when the operating system temporarily interrupts a process, saving its state, so the CPU can be reassigned to another process.Which operating system is known for its emphasis on simplicity and portability and is widely used in embedded systems?
A. Windows
B. Linux
C. MacOS
D. Minix
Answer: D. Minix
Explanation: Minix is a small, simple, and portable operating system, making it ideal for educational purposes and embedded systems.
What is the primary role of the Process Control Block (PCB) in process management?
A. Managing inter-process communication
B. Storing the executable code of a process
C. Controlling access to hardware resources
D. Holding information about a process's state and resource usage
Answer: D. Holding information about a process's state and resource usage
Explanation: The PCB maintains all the necessary information about a process, including its current state, priority, program counter, and allocated resources.Which operation on processes involves creating a new process that is a copy of the current process?
A. Forking
B. Executing
C. Suspending
D. Blocking
Answer: A. Forking
Explanation: Forking creates a new process by duplicating the existing process, sharing the same code and resources.In the context of the process life cycle, what is the initial state of a process when it is first created?
A. Ready
B. Running
C. New
D. Terminated
Answer: C. New
Explanation: A process enters the "New" state immediately after creation, awaiting admission to the ready queue.What is the primary difference between a process and a thread?
A. Processes run in user mode; threads in supervisor mode
B. Processes have their own memory space; threads share the same memory space
C. Processes are created by the operating system; threads are created by applications
D. Processes are single-threaded; threads can be multi-threaded
Answer: B. Processes have their own memory space; threads share the same memory space
Explanation: Threads within the same process share the process's memory and resources, whereas processes have separate memory spaces.Which system call is responsible for creating a new process in UNIX-like operating systems?
A. create_process()
B. fork()
C. new_process()
D. spawn()
Answer: B. fork()
Explanation: Thefork()
system call is used in UNIX-like operating systems to create a new process by duplicating the existing process.
What is the primary advantage of using threads in a multi-threaded process?
A. Increased security
B. Improved resource utilization
C. Simplified program design
D. Better I/O performance
Answer: B. Improved resource utilization
Explanation: Threads allow better resource utilization by sharing memory and other resources within a process, enabling more efficient execution of concurrent tasks.What is a critical section in the context of process synchronization?
A. A section of code that must be executed atomically
B. A section of code that is rarely used
C. A section of code that is executed by the supervisor mode
D. A section of code that is not allowed in multi-threaded processes
Answer: A. A section of code that must be executed atomically
Explanation: A critical section is a segment of code where shared resources are accessed and must be executed without interruption to avoid inconsistencies.Which scheduling algorithm aims to minimize the waiting time of processes in the ready queue?
A. First-Come, First-Served (FCFS)
B. Shortest Job Next (SJN)
C. Round Robin (RR)
D. Priority Scheduling
Answer: B. Shortest Job Next (SJN)
Explanation: The SJN algorithm selects the process with the shortest execution time, reducing the average waiting time.What is the purpose of a system call in the context of an operating system?
A. Managing system resources
B. Providing a user interface
C. Allowing user programs to request services from the operating system
D. Running applications
Answer: C. Allowing user programs to request services from the operating system
Explanation: System calls provide an interface for user programs to interact with the operating system for services like file operations and process management.In the context of process termination, what does the 'exit()' system call do?
A. Exits the operating system
B. Terminates the currently executing process
C. Suspends the process temporarily
D. Creates a new process
Answer: B. Terminates the currently executing process
Explanation: Theexit()
system call signals the operating system to terminate a process and release its allocated resources.