Operating System MCQs with Answers
Practice important Operating System MCQs with answers and explanations.
Chapter: 12
Q321:
What is a key advantage of using threads in a process?
A. Improved memory management
B. Improved CPU scheduling
C. Easier debugging
D. More efficient process termination
Correct Answer:
B
Chapter: 12
Q322:
Which key press is used to terminate a process in UNIX/Linux?
A. <Ctrl-Z>
B. <Ctrl-X>
C. <Ctrl-C>
D. <Ctrl-V>
Correct Answer:
C
Chapter: 12
Q323:
The kill command can send different types of signals, such as SIGINT and _________.
A. SIGTERM
B. SIGCONT
C. SIGSTOP
D. SIGUSR1
Correct Answer:
A
Chapter: 12
Q324:
A process with multiple threads can perform _________.
A. Multiple tasks simultaneously
B. One task at a time
C. No tasks
D. Parallel data processing
Correct Answer:
A
Chapter: 12
Q325:
The fork() system call creates a new _________.
A. Thread
B. Process
C. Job
D. PID
Correct Answer:
B
Chapter: 12
Q326:
Which of the following is the default signal for the kill command?
A. SIGTERM
B. SIGKILL
C. SIGINT
D. SIGSTOP
Correct Answer:
A
Chapter: 13
Q327:
Which of the following is a user-level thread library?
A. POSIX Pthreads
B. Solaris 2 UI-threads
C. Mach C threads
D. All of the above
Correct Answer:
D
Chapter: 13
Q328:
In the Many-to-One model, how many kernel threads are there?
A. One
B. Many
C. None
D. Multiple
Correct Answer:
A
Chapter: 13
Q329:
Which of the following is true for kernel-level threads?
A. They are faster to create and manage
B. They are managed by the user space
C. They provide better concurrency
D. They block the entire process on system calls
Correct Answer:
C
Chapter: 13
Q330:
Which operating system uses the One-to-One thread model?
A. Windows NT
B. Solaris 2
C. BeOS
D. HP-UX
Correct Answer:
A
Chapter: 13
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
Correct Answer:
A
Chapter: 13
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
Correct Answer:
B
Chapter: 13
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 *));
Correct Answer:
A
Chapter: 13
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
Correct Answer:
D
Chapter: 13
Q335:
Which of the following is NOT a valid error code for pthread_create()?
A. EAGAIN
B. EINVAL
C. ENOMEM
D. EEXIT
Correct Answer:
D
Chapter: 13
Q336:
Which of the following operating systems support kernel threads?
A. Solaris 2
B. Windows NT
C. BeOS
D. All of the above
Correct Answer:
D
Chapter: 13
Q337:
Which call is used to terminate a thread in POSIX threads?
A. pthread_exit()
B. pthread_join()
C. pthread_create()
D. exit()
Correct Answer:
A
Chapter: 13
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
Correct Answer:
A
Chapter: 13
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
Correct Answer:
B
Chapter: 13
Q340:
Which programming languages support POSIX threads?
A. Java
B. Python
C. C
D. Ruby
Correct Answer:
C