Operating System MCQs with Answers
Practice important Operating System MCQs with answers and explanations.
Multiple Choice Questions
Q331: In the Solaris 2 threads model, how many kernel threads are associated with a user process?
- A: One
- B: None
- C: Multiple
- D: One or more
View Answer
A
Q332: What does the pthread_create() function do in POSIX threads?
- A: Creates a new process
- B: Creates a new thread
- C: Joins a thread
- D: Terminates a thread
View Answer
B
Q333: Which of the following is the correct syntax for the pthread_create() function?
- A: int pthread_create(pthread_t *threadp, const pthread_attr_t attr, void (*routine)(void *), arg *arg);
- B: int create_thread(pthread_t threadp, void (*routine)(void *), arg *arg);
- C: void pthread_create(void* (*routine)(void *), arg *arg);
- D: void pthread_create(pthread_t threadp, void (*routine)(void *));
View Answer
A
Q334: What will happen if you try to join a detached thread?
- A: The program will crash
- B: The thread will be ignored
- C: The program will hang
- D: An error will occur
View Answer
D
Q335: Which of the following is NOT a valid error code for pthread_create()?
- A: EAGAIN
- B: EINVAL
- C: ENOMEM
- D: EEXIT
View Answer
D
Q336: Which of the following operating systems support kernel threads?
- A: Solaris 2
- B: Windows NT
- C: BeOS
- D: All of the above
View Answer
D
Q337: Which call is used to terminate a thread in POSIX threads?
- A: pthread_exit()
- B: pthread_join()
- C: pthread_create()
- D: exit()
View Answer
A
Q338: What does the pthread_exit() function do?
- A: Terminates a thread
- B: Joins a thread
- C: Creates a new thread
- D: Terminates the process
View Answer
A
Q339: Which of the following can be passed as arguments to a thread function in POSIX threads?
- A: Integer values
- B: Structure pointers
- C: Floating-point numbers
- D: Strings only
View Answer
B
Q340: Which programming languages support POSIX threads?
- A: Java
- B: Python
- C: C
- D: Ruby
View Answer
C