Operating System: Question Set – 10

Operating System: Question Set – 10

What are the main components of a process?

  • Program Code: The instructions to be executed.
  • Program Counter: The address of the next instruction.
  • Stack: Contains temporary data like function parameters, return addresses, and local variables.
  • Data Section: Contains global variables.
  • Heap: Contains dynamically allocated memory.

What is the role of the operating system in process management?

Process creation, scheduling, execution, and termination fall under the purview of the operating system. Deadlock resolution, resource allocation, and inter-process communication are also managed by it.

What is a parent and child process?

  • A parent process is the process that creates another process.
  • A child process is the process created by the parent process. Child processes inherit some properties of the parent.

What is the difference between cooperative and preemptive multitasking?

  • Cooperative multitasking: Processes voluntarily yield control to allow others to execute.
  • Preemptive multitasking: The OS forcibly switches between processes based on scheduling policies.

What is process synchronization?

Process synchronization guarantees that when several threads or processes use shared resources, they do so in a predictable way.

What are the different process scheduling algorithms?

  • First-Come, First-Served (FCFS)
  • Shortest Job Next (SJN)
  • Priority Scheduling
  • Round-Robin (RR)
  • Multilevel Queue Scheduling
  • Multilevel Feedback Queue Scheduling

What is the difference between user-level and kernel-level threads?

  • User-level threads are managed by user-space libraries and are lightweight.
  • Kernel-level threads are managed by the OS and provide better multitasking support.

What is starvation in scheduling?

When a process waits endlessly for CPU time or resources because the scheduling algorithm favors other processes (such as low-priority processes in priority scheduling), this is known as starvation.

What is process migration?

In distributed systems, process migration is the process of transferring a process from one system to another in order to enhance resource usage or balance the load.

What is the difference between hard and soft real-time systems?

  • Hard real-time systems: Require tasks to complete within strict deadlines (e.g., pacemakers).
  • Soft real-time systems: Allow some flexibility in meeting deadlines (e.g., video streaming)

What are the benefits of multi-threaded processes?

  • Increased responsiveness.
  • Resource sharing within the same process.
  • Better utilization of multiprocessor architectures.
  • Scalability and modularity.

What is the difference between fork() and exec()?

  • fork(): Creates a new process (child process) as a copy of the parent process.
  • exec(): Replaces the current process’s memory space with a new program.

What is a context-free process?

A simple process that doesn’t need to be synchronized or interact with other processes is known as a context-free process.

What is the difference between synchronous and asynchronous processes?

  • Synchronous processes execute tasks sequentially, waiting for one task to complete before starting the next.
  • Asynchronous processes can execute tasks concurrently without waiting for other tasks to complete.

Leave a Reply

Your email address will not be published. Required fields are marked *