Skip to main content

Operating System MCQs with Answers

Practice important Operating System MCQs with answers and explanations.

Chapter: 13
Q341:
In the many-to-one model, if a thread performs a system call, what happens?
A. Only that thread blocks
B. The entire process blocks
C. Only other threads block
D. None of the above
Correct Answer: B
Chapter: 13
Q342:
The pthread_join() function is used to:
A. Create a thread
B. Terminate a thread
C. Wait for a thread to terminate
D. Execute the thread function
Correct Answer: C
Chapter: 13
Q343:
What type of thread is created by the pthread_create() function in POSIX threads?
A. Kernel thread
B. User thread
C. Process thread
D. None of the above
Correct Answer: B
Chapter: 13
Q344:
Which of the following does the pthread_create() function NOT handle?
A. Thread scheduling
B. Thread creation
C. Thread termination
D. Thread management
Correct Answer: A
Chapter: 13
Q345:
The POSIX threads library is a specification for:
A. Thread creation and scheduling
B. Thread creation only
C. Thread management only
D. Process creation
Correct Answer: A
Chapter: 13
Q346:
In the example program, what message does the child thread print?
A. Exiting the main function
B. Hello, world! ... The threaded version
C. Thread ID and sum
D. None of the above
Correct Answer: B
Chapter: 13
Q347:
Which function is used to initialize a thread in POSIX threads?
A. pthread_create()
B. pthread_join()
C. pthread_init()
D. pthread_start()
Correct Answer: A
Chapter: 13
Q348:
The 'sleep()' function in the code is used for:
A. Allowing thread to terminate
B. Temporarily suspending thread execution
C. Sleeping the whole process
D. Creating a new thread
Correct Answer: B
Chapter: 13
Q349:
Which function is used to create a thread in the hello_arg2.c code?
A. pthread_create()
B. thread_create()
C. pthread_initialize()
D. create_thread()
Correct Answer: A
Chapter: 13
Q350:
What is the correct term for threads managed by the kernel?
A. User threads
B. Kernel threads
C. Lightweight threads
D. Process threads
Correct Answer: B
Chapter: 13
Q351:
What is the correct syntax to join a thread in POSIX?
A. pthread_join(pthread_t thread, void *status);
B. pthread_join(thread_t, status);
C. pthread_join();
D. thread_join();
Correct Answer: A
Chapter: 13
Q352:
In the hello_arg2.c program, how are the messages passed to threads?
A. Through a global array
B. Using thread arguments
C. Using global variables
D. Directly within the thread function
Correct Answer: B
Chapter: 14
Q353:
The objective of multiprogramming is to maximize _______.
A. CPU utilization
B. Memory usage
C. Process execution
D. Device utilization
Correct Answer: A
Chapter: 14
Q354:
In multiprogramming, a process is executed until it must wait for _______.
A. I/O request
B. CPU burst
C. Memory allocation
D. Termination signal
Correct Answer: A
Chapter: 14
Q355:
Which of the following is an example of a CPU burst?
A. CPU waiting
B. I/O processing
C. Executing a program
D. None of the above
Correct Answer: C
Chapter: 14
Q356:
The short-term scheduler is also known as the _______.
A. CPU scheduler
B. Memory manager
C. Process dispatcher
D. Resource manager
Correct Answer: A
Chapter: 14
Q357:
What is the main task of the dispatcher?
A. Allocate memory
B. Restore context
C. Execute processes
D. Allocate CPU resources
Correct Answer: B
Chapter: 14
Q358:
Which scheduling method requires no special hardware?
A. Preemptive scheduling
B. Non-preemptive scheduling
C. Both A and B
D. None of the above
Correct Answer: B
Chapter: 14
Q359:
Which of the following scheduling algorithms is non-preemptive?
A. FCFS
B. Shortest Job First (SJF)
C. Round Robin
D. All of the above
Correct Answer: A
Chapter: 14
Q360:
The time it takes for the dispatcher to stop one process and start another is called _______.
A. Dispatch latency
B. Context switch time
C. Preemptive latency
D. CPU time
Correct Answer: B

Test Your Knowledge

Take a timed quiz on Operating System

🚀 Start Quiz Now