Operating System MCQs with Answers
Practice important Operating System MCQs with answers and explanations.
Multiple Choice Questions
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
View Answer
B
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
View Answer
C
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
View Answer
B
Q344: Which of the following does the pthread_create() function NOT handle?
- A: Thread scheduling
- B: Thread creation
- C: Thread termination
- D: Thread management
View Answer
A
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
View Answer
A
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
View Answer
B
Q347: Which function is used to initialize a thread in POSIX threads?
- A: pthread_create()
- B: pthread_join()
- C: pthread_init()
- D: pthread_start()
View Answer
A
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
View Answer
B
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()
View Answer
A
Q350: What is the correct term for threads managed by the kernel?
- A: User threads
- B: Kernel threads
- C: Lightweight threads
- D: Process threads
View Answer
B