Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 12

Lec11.CS604 to Lec20.

CS604
Choose the correct option.
1. Which command is used to create a FIFO pipe in Linux?
a) mkfifo
b) pipe
c) fifo
d) mkpipe
2. What is the purpose of the mkfifo command?
a) To create a new process
b) To create a new pipe
c) To create a new FIFO special file
d) To create a new file system
3. Which command is used to list all running processes in Linux?
a) ps
b) pidof
c) pgrep
d) process
4. What is the purpose of the ps command?
a) To create a new process
b) To list all running processes
c) To stop a running process
d) To start a new process
5. Which command is used to pause a running process in Linux?
a) pause
b) stop
c) kill
d) sigstop
6. What is the purpose of the fg command in Linux?
a) To move a process to the background
b) To move a process to the foreground
c) To pause a process
d) To start a new process
7. Which command is used to send a signal to a process in Linux?
a) signal
b) sigsend
c) kill
d) pkill
8. What is the purpose of the pipe command in Linux?
a) To create a new process
b) To create a new pipe
c) To connect two processes via a pipe
d) To disconnect two processes via a pipe
9. Which command is used to display information about processes in Linux?
a) pidof
b) pgrep
c) ps
d) process
10. What is the purpose of the pkill command in Linux?
a) To pause a process
b) To kill a process
c) To start a new process
d) To list all running processes
11. A thread is also called _______
a) Light Weight Process (LWP)
b) Heavy Weight Process (HWP)
c) Process
d) None of the mentioned
12. A thread shares its resources with _______
a) other process similar to the one that the thread belongs to
b) other threads that belong to similar processes
c) other threads that belong to the same process
d) all of the mentioned
13. The model in which one kernel thread is mapped to many user-level threads is called
_______
a) Many to One model
b) One to Many model
c) Many to Many model
d) One to One model
14. In the Many to One model, if a thread makes a blocking system call _______
a) the entire process will be blocked
b) a part of the process will stay blocked, with the rest running
c) the entire process will run
d) none of the mentioned
15. Multithreading on a multi-CPU machine _______
a) decreases concurrency
b) increases concurrency
c) doesn’t affect the concurrency
d) can increase or decrease the concurrency
16. If a kernel thread performs a blocking system call, _______
a) the kernel can schedule another thread in the application for execution
b) the kernel cannot schedule another thread in the same application for execution
c) the kernel must schedule another thread of a different application for execution
d) the kernel must schedule another thread of the same application on a different
processor
17. The kernel is _______ of user threads.
a) a part of
b) the creator of
c) unaware of
d) aware of
18. Which of the following is FALSE?
a) Context switch time is longer for kernel level threads than for user level threads
b) User level threads do not need any hardware support
c) Related kernel level threads can be scheduled on different processors in a
multiprocessor system
d) Blocking one kernel level thread blocks all other related threads
19. Resource sharing helps _______
a) share the memory and resources of the process to which the threads belong
b) an application have several different threads of activity all within the same address
space
c) reduce the address space that a process could potentially use
d) all of the mentioned
20. Multithreading an interactive program will increase responsiveness to the user by
_______
a) continuing to run even if a part of it is blocked
b) waiting for one part to finish before the other begins
c) asking the user to decide the order of multithreading
d) none of the mentioned
21. Which of the following is a characteristic of single-threaded programs?
a) Concurrent execution of tasks
b) Shared memory space
c) Fast context switching
d) Sequential execution of tasks
22. What is the primary advantage of multithreaded programs over single-threaded
programs?
a) Improved responsiveness
b) Increased memory usage
c) Reduced CPU utilization
d) Simplified program design
23. Which thread model allows multiple user-level threads to be mapped to a single kernel
thread?
a) One-to-One
b) Many-to-One
c) Many-to-Many
d) One-to-Many
24. What is the primary difference between user threads and kernel threads?
a) Resource allocation
b) Scheduling priority
c) Creation overhead
d) Execution context
25. Which library provides a standardized API for creating and managing threads in C?
a) pthreads
b) threads
c) concurrency
d) parallel
26. What is the purpose of the pthread_join function?
a) Create a new thread
b) Terminate a thread
c) Synchronize thread execution
d) Wait for a thread to complete
27. Which of the following is a benefit of using pthreads?
a) Reduced portability
b) Increased overhead
c) Simplified thread management
d) Limited scalability
28. How do kernel threads improve system performance?
a) By reducing context switching overhead
b) By increasing thread creation overhead
c) By prioritizing thread scheduling
d) By limiting thread concurrency
29. What is the primary advantage of the Many-to-Many thread model?
a) Improved responsiveness
b) Increased concurrency
c) Reduced overhead
d) Simplified thread management
30. Which of the following is a limitation of user-level threads?
a) Limited concurrency
b) High creation overhead
c) Limited scalability
d) No kernel support
31. Which component of the operating system is responsible for selecting the next process to
run?
a) Short-term scheduler
b) Long-term scheduler
c) Dispatcher
d) Swapper
32. What is the primary function of the dispatcher?
a) To select the next process to run
b) To allocate resources to processes
c) To context switch between processes
d) To manage the ready queue
33. When is the scheduler invoked?
a) When a process is created
b) When a process is terminated
c) When a process is blocked
d) When a process is ready to run
34. What is the optimization criterion for FCFS scheduling?
a) Minimize average turnaround time
b) Maximize CPU utilization
c) Minimize average response time
d) First-come, first-served
35. Which scheduling algorithm is also known as the Run-to-Completion algorithm?
a) FCFS
b) SJF
c) Priority Scheduling
d) Round Robin
36. What is the main advantage of FCFS scheduling?
a) Good average-case performance
b) Good worst-case performance
c) Low overhead
d) Starvation-free
37. Which of the following is a disadvantage of FCFS scheduling?
a) Poor average-case performance
b) Poor worst-case performance
c) High overhead
d) Starvation-free
38. When a process arrives at the ready queue, what does the scheduler do?
a) Context switches to the new process
b) Adds the process to the end of the queue
c) Adds the process to the front of the queue
d) Removes the process from the queue
39. What happens when the currently running process is terminated?
a) The dispatcher context switches to the next process
b) The scheduler is invoked to select a new process
c) The ready queue is updated
d) All of the above
40. Which of the following is NOT a characteristic of FCFS scheduling?
a) Processes are executed in the order they arrive
b) Each process runs to completion before the next one starts
c) The scheduler is invoked only when a process is terminated
d) The ready queue is always empty
41. Which scheduling algorithm is optimal for average turnaround time?
a) FCFS
b) SJF
c) Priority Scheduling
d) RR
42. What is the main difference between preemptive and non-preemptive SJF scheduling?
a) Context switching overhead
b) Priority assignment
c) Process selection
d) Interrupt handling
43. In RR scheduling, what is the time slice allocated to each process called?
a) Time quantum
b) Time slice
c) Round robin
d) Context switch
44. Which scheduling algorithm is best suited for real-time systems?
a) FCFS
b) SJF
c) Priority Scheduling
d) RR
45. In Priority Scheduling, which process is executed first?
a) Highest priority process
b) Lowest priority process
c) Longest running process
d) Shortest running process
46. What is the main advantage of Priority Scheduling?
a) Good average-case performance
b) Good worst-case performance
c) Low overhead
d) Starvation-free
47. Which of the following is a disadvantage of SJF scheduling?
a) Poor average-case performance
b) Poor worst-case performance
c) High overhead
d) Starvation-free
48. In RR scheduling, what happens when a process uses up its time quantum?
a) It is terminated
b) It is context switched
c) It is put at the end of the ready queue
d) It is given another time quantum
49. Which scheduling algorithm is most susceptible to starvation?
a) FCFS
b) SJF
c) Priority Scheduling
d) RR
50. What is the main advantage of RR scheduling?
a) Good average-case performance
b) Good worst-case performance
c) Low overhead
d) Fairness
51. Which scheduling algorithm is optimal in terms of average turnaround time?
a) FCFS
b) SJF
c) Priority
d) Round Robin
52. Which algorithm assigns a fixed time slice to each process?
a) SJF
b) Round Robin
c) Priority
d) FCFS
53. In Multilevel Queue Scheduling, which queue has the highest priority?
a) System processes
b) Interactive processes
c) Batch processes
d) Real-time processes
54. What is the time slice allocated to each process in Round Robin Scheduling called?
a) Time quantum
b) Time slice
c) Time allocation
d) Time slot
55. Which algorithm is prone to starvation?
a) SJF
b) Priority
c) Round Robin
d) FCFS
56. In SJF, which process is executed first?
a) The process with the longest burst time
b) The process with the shortest burst time
c) The process with the highest priority
d) The process that arrived first
57. Which scheduling algorithm is simple and easy to implement?
a) SJF
b) Priority
c) Round Robin
d) FCFS
58. In Multilevel Queue Scheduling, which algorithm is used for scheduling processes within
a queue?
a) FCFS
b) SJF
c) Priority
d) Round Robin
59. What is the main advantage of Round Robin Scheduling?
a) Optimality
b) Low overhead
c) Good average-case performance
d) Good responsiveness
60. Which algorithm is suitable for real-time systems?
a) SJF
b) Priority
c) Round Robin
d) FCFS
61. Which scheduling algorithm uses multiple queues with different scheduling algorithms?
a) Multilevel Queue Scheduling
b) Multilevel Feedback Queue Scheduling
c) Round Robin
d) Priority Scheduling
62. Which algorithm dynamically changes the priority of processes based on their behavior?
a) Multilevel Queue Scheduling
b) Multilevel Feedback Queue Scheduling
c) Round Robin
d) Priority Scheduling
63. Which UNIX system scheduling algorithm is similar to Multilevel Feedback Queue
Scheduling?
a) Round Robin
b) Priority Scheduling
c) FCFS
d) Multilevel Feedback Queue
64. Which scheduling algorithm is used in UNIX System V?
a) Multilevel Queue Scheduling
b) Multilevel Feedback Queue Scheduling
c) Round Robin
d) FCFS
65. What is the main advantage of Multilevel Queue Scheduling?
a) Dynamic priority adjustment
b) Efficient use of resources
c) Low overhead
d) Good responsiveness
66. Which algorithm is suitable for systems with diverse process requirements?
a) Multilevel Queue Scheduling
b) Multilevel Feedback Queue Scheduling
c) Round Robin
d) Priority Scheduling
67. Which scheduling algorithm is used in UNIX BSD?
a) Round Robin
b) Priority Scheduling
c) FCFS
d) Multilevel Feedback Queue
68. What is the main difference between Multilevel Queue and Multilevel Feedback Queue
Scheduling?
a) Number of queues
b) Scheduling algorithm used
c) Priority assignment
d) Feedback mechanism
69. Which algorithm is prone to starvation in a UNIX system?
a) Multilevel Feedback Queue
b) Round Robin
c) Priority Scheduling
d) FCFS
70. Which scheduling algorithm is used in modern UNIX systems like Linux?
a) Multilevel Queue Scheduling
b) Multilevel Feedback Queue Scheduling
c) Completely Fair Scheduler (CFS)
d) Round Robin
71. What is the primary goal of the scheduling algorithm in UNIX System V?
a) Maximize CPU utilization
b) Minimize average turnaround time
c) Ensure fairness and predictability
d) Prioritize processes based on priority
72. Which metric measures the time spent by a process in the ready queue?
a) Response time
b) Turnaround time
c) Waiting time
d) Execution time
73. What is the main advantage of using semaphores for process synchronization?
a) Easy to implement
b) Efficient use of resources
c) Prevents race conditions
d) Prioritizes processes
74. Which system call is used to create a new process in UNIX systems?
a) fork
b) exec
c) wait
d) nice
75. What is the purpose of the exec system call in UNIX systems?
a) To create a new process
b) To execute a new program
c) To synchronize processes
d) To terminate a process
76. What is the main difference between a semaphore and a mutex?
a) Semaphore is a locking mechanism, while mutex is a synchronization mechanism
b) Semaphore is a synchronization mechanism, while mutex is a locking mechanism
c) Semaphore is used for process synchronization, while mutex is used for thread
synchronization
d) Semaphore is used for thread synchronization, while mutex is used for process
synchronization
77. Which process state is characterized by a process executing in the CPU?
a) Running
b) Sleeping
c) Waiting
d) Zombie
78. What is the purpose of the kill command in UNIX systems?
a) To terminate a process
b) To prioritize a process
c) To synchronize processes
d) To create a new process
79. Which metric measures the time spent by a process in the CPU?
a) Response time
b) Turnaround time
c) Execution time
d) Waiting time
80. Which algorithm is used to schedule processes in the background in UNIX systems?
a) FCFS
b) SJF
c) Priority Scheduling
d) Multilevel Feedback Queue
81. What is the Bounded Buffer Problem?
a) A producer-consumer problem with unlimited buffer size
b) A producer-consumer problem with a finite buffer size
c) A synchronization problem between two processes
d) A scheduling problem in operating systems
82. Which problem is related to accessing shared resources in a multiprocessing system?
a) Bounded Buffer Problem
b) Critical Section Problem
c) Producer-Consumer Problem
d) Scheduling Problem
83. What is the main goal of a good solution to the Critical Section Problem?
a) To maximize CPU utilization
b) To minimize response time
c) To ensure mutual exclusion and progress
d) To prioritize processes
84. Which condition must be met for a good solution to the Critical Section Problem?
a) Mutual exclusion
b) Progress
c) Bounded waiting
d) All of the above
85. What is the purpose of a semaphore in solving the Bounded Buffer Problem?
a) To synchronize access to the buffer
b) To prioritize producers over consumers
c) To ensure mutual exclusion
d) To maximize buffer size
86. Which algorithm is used to solve the Critical Section Problem?
a) Dekker's algorithm
b) Dijkstra's algorithm
c) Lamport's algorithm
d) All of the above
87. What is the main advantage of using semaphores to solve the Critical Section Problem?
a) Easy to implement
b) Efficient use of resources
c) Ensures mutual exclusion and progress
d) Prioritizes processes
88. Which problem is related to accessing a shared buffer in a producer-consumer system?
a) Critical Section Problem
b) Bounded Buffer Problem
c) Producer-Consumer Problem
d) Scheduling Problem
89. What is the purpose of the wait and signal operations in a semaphore?
a) To increment and decrement the semaphore value
b) To lock and unlock the critical section
c) To prioritize processes
d) To synchronize access to the buffer
90. Which condition is NOT required for a good solution to the Critical Section Problem?
a) Mutual exclusion
b) Progress
c) Bounded waiting
d) Prioritization
91. What is the 2-Process Critical Section Problem?
a) A problem of accessing shared resources by 2 processes
b) A problem of accessing shared resources by N processes
c) A problem of synchronization between 2 processes
d) A problem of communication between 2 processes
92. Which algorithm is used to solve the 2-Process Critical Section Problem?
a) Dekker's algorithm
b) Dijkstra's algorithm
c) Lamport's algorithm
d) Bakery algorithm
93. What is the N-Process Critical Section Problem?
a) A problem of accessing shared resources by 2 processes
b) A problem of accessing shared resources by N processes
c) A problem of synchronization between N processes
d) A problem of communication between N processes
94. Which algorithm is used to solve the N-Process Critical Section Problem?
a) Dekker's algorithm
b) Dijkstra's algorithm
c) Lamport's algorithm
d) Bakery algorithm
95. What is the main advantage of the Bakery Algorithm?
a) Easy to implement
b) Efficient use of resources
c) Ensures mutual exclusion and progress
d) Prioritizes processes
96. How does the Bakery Algorithm work?
a) By assigning a unique number to each process
b) By using a semaphore to synchronize access
c) By prioritizing processes based on arrival time
d) By using a token to grant access
97. What is the purpose of the "ticket" in the Bakery Algorithm?
a) To prioritize processes
b) To synchronize access
c) To assign a unique number to each process
d) To grant access to the critical section
98. Which process gets priority in the Bakery Algorithm?
a) The process with the highest ticket number
b) The process with the lowest ticket number
c) The process that arrived first
d) The process that arrived last
99. What happens when a process finishes executing the critical section in the Bakery
Algorithm?
a) It releases the token
b) It increments its ticket number
c) It decrements its ticket number
d) It resets its ticket number
100. Why is the Bakery Algorithm considered a good solution to the N-Process Critical
Section Problem?
a) Because it is easy to implement
b) Because it is efficient
c) Because it ensures mutual exclusion and progress
d) Because it prioritizes processes

You might also like