Mock Quiz Hub
Dark
Mock Quiz Hub
1
Recent Updates
Added: OS Mid 1 Quiz
Added: OS Mid 2 Quiz
Added: OS Lab 1 Quiz
Check back for more updates!
Time: 00:00
Quiz
Navigate through questions using the controls below
0%
Question 1 of 60
Quiz ID: q1
What is the primary motivation for using threads in modern applications?
To increase process creation overhead
To simplify code and increase efficiency
To reduce memory usage
To eliminate the need for synchronization
Question 2 of 60
Quiz ID: q2
What is the main difference between a process and a thread?
Processes share memory, threads do not
Threads are heavier-weight than processes
A process contains multiple threads which share resources
Threads have their own address space
Question 3 of 60
Quiz ID: q3
In a multithreaded server architecture, what happens after a request is received?
The server process terminates
A new process is created to handle the request
A new thread is created to service the request
The request is ignored
Question 4 of 60
Quiz ID: q4
Which of the following is NOT a benefit of multithreading?
Responsiveness
Resource Sharing
Economy
Increased security
Question 5 of 60
Quiz ID: q5
What does 'economy' refer to in the context of threads?
Reduced memory usage
Cheaper creation and switching compared to processes
Faster execution speed
Lower power consumption
Question 6 of 60
Quiz ID: q6
What is the difference between parallelism and concurrency?
They are identical concepts
Parallelism requires multiple cores, concurrency does not
Concurrency requires multiple cores, parallelism does not
Parallelism is for processes, concurrency is for threads
Question 7 of 60
Quiz ID: q7
What is data parallelism?
Distributing different tasks across cores
Distributing subsets of the same data across cores for identical operations
Processing data sequentially
Using different algorithms on the same data
Question 8 of 60
Quiz ID: q8
What is task parallelism?
Distributing identical tasks across cores
Distributing different tasks or operations across cores
Processing tasks sequentially
Using the same algorithm on different data
Question 9 of 60
Quiz ID: q9
According to Amdahl's Law, what limits the speedup from adding more cores?
The parallel portion of the application
The serial portion of the application
The clock speed of the cores
The amount of memory available
Question 10 of 60
Quiz ID: q10
What are user threads?
Threads managed by the operating system kernel
Threads managed by a user-level threads library
Threads created by the root user
Threads that perform user interface operations
Question 11 of 60
Quiz ID: q11
What are kernel threads?
Threads managed by a user-level library
Threads managed by the operating system kernel
Threads that only run kernel code
Threads with elevated privileges
Question 12 of 60
Quiz ID: q12
Which multithreading model maps many user threads to a single kernel thread?
One-to-One
Many-to-Many
Many-to-One
Two-level
Question 13 of 60
Quiz ID: q13
What is a disadvantage of the Many-to-One model?
It requires too many kernel resources
If one thread blocks, all threads block
It doesn't support multithreading
It only works on single-core systems
Question 14 of 60
Quiz ID: q14
Which multithreading model maps each user thread to a kernel thread?
Many-to-One
One-to-One
Many-to-Many
Two-level
Question 15 of 60
Quiz ID: q15
Which operating systems typically use the One-to-One model?
Solaris Green Threads
GNU Portable Threads
Windows and Linux
Traditional UNIX systems
Question 16 of 60
Quiz ID: q16
What is the Two-level model?
A variant of Many-to-Many that allows binding user threads to kernel threads
A model with two user threads per kernel thread
A model with two kernel threads per user thread
A model that only uses two threads total
Question 17 of 60
Quiz ID: q17
What is Pthreads?
A Windows-specific thread API
A Java thread implementation
A POSIX standard API for thread creation and synchronization
A hardware threading technology
Question 18 of 60
Quiz ID: q18
In Pthreads, what does pthread_create() do?
Terminates a thread
Creates a new thread
Synchronizes threads
Sets thread attributes
Question 19 of 60
Quiz ID: q19
In Pthreads, what does pthread_join() do?
Creates a thread
Waits for a thread to terminate
Cancels a thread
Sets thread priority
Question 20 of 60
Quiz ID: q20
How are Java threads typically created?
By extending the Thread class or implementing the Runnable interface
By calling the create_thread() system call
By using the pthread library
By using Windows API calls
Question 21 of 60
Quiz ID: q21
What is the Executor framework in Java?
A low-level thread manipulation API
A framework for creating and managing thread pools
A hardware execution unit
A process scheduling algorithm
Question 22 of 60
Quiz ID: q22
What is implicit threading?
Threads that are invisible to the programmer
Thread creation and management done by compilers and runtime libraries
Threads that are created automatically by the kernel
Threads that cannot be controlled by the programmer
Question 23 of 60
Quiz ID: q23
What is a thread pool?
A collection of processes
A set of precreated threads that await work
A memory area for thread stacks
A pool of processor cores
Question 24 of 60
Quiz ID: q24
What are the advantages of thread pools?
They eliminate the need for synchronization
They allow unlimited thread creation
They are faster than creating new threads for each task and allow bounding thread numbers
They make all threads run at higher priority
Question 25 of 60
Quiz ID: q25
What is fork-join parallelism?
A model where threads are forked but never joined
A model where tasks are recursively split (forked) and then combined (joined)
A model where processes are forked instead of threads
A model that only works on UNIX systems
Question 26 of 60
Quiz ID: q26
In Java's fork-join framework, what is the difference between RecursiveTask and RecursiveAction?
RecursiveTask returns a result, RecursiveAction does not
RecursiveAction returns a result, RecursiveTask does not
RecursiveTask is for I/O operations, RecursiveAction is for computation
There is no difference
Question 27 of 60
Quiz ID: q27
What is OpenMP?
A Java threading API
A set of compiler directives and API for parallel programming
A Windows thread management tool
A hardware feature for parallelism
Question 28 of 60
Quiz ID: q28
What is Grand Central Dispatch (GCD)?
A Windows threading technology
A Java executor service
Apple's technology for macOS and iOS parallelism
A Linux kernel threading feature
Question 29 of 60
Quiz ID: q29
What are the two types of dispatch queues in GCD?
Fast and slow queues
User and kernel queues
Serial and concurrent queues
Input and output queues
Question 30 of 60
Quiz ID: q30
What is Intel Threading Building Blocks (TBB)?
A hardware threading feature
A template library for parallel C++ programming
A Java threading framework
A Windows thread pool implementation
Question 31 of 60
Quiz ID: q31
What is a threading issue related to fork() and exec()?
Whether fork() duplicates all threads or just the calling thread
Whether exec() creates new threads
Whether fork() and exec() can be called from threads
Whether threads can exist after exec()
Question 32 of 60
Quiz ID: q32
How are signals typically handled in multithreaded programs?
Signals are always delivered to all threads
Signals are always delivered to the main thread only
Different strategies exist: deliver to specific thread, all threads, or certain threads
Signals cannot be used in multithreaded programs
Question 33 of 60
Quiz ID: q33
What is thread cancellation?
Creating a new thread
Terminating a thread before it has finished
Suspending a thread temporarily
Changing thread priority
Question 34 of 60
Quiz ID: q34
What is the difference between asynchronous and deferred cancellation?
Asynchronous is immediate, deferred allows the thread to check for cancellation
Deferred is immediate, asynchronous allows the thread to check
They are identical
Asynchronous is for user threads, deferred is for kernel threads
Question 35 of 60
Quiz ID: q35
What is thread-local storage (TLS)?
Storage shared by all threads in a process
Storage that is unique to each thread
Storage for thread control blocks
Storage for thread stacks
Question 36 of 60
Quiz ID: q36
What is the purpose of scheduler activations?
To activate the scheduler more frequently
To provide communication between kernel and thread library for maintaining appropriate kernel threads
To schedule threads at higher priority
To deactivate threads temporarily
Question 37 of 60
Quiz ID: q37
What is an LWP (Lightweight Process)?
A thread with minimal memory usage
A user-level thread
A virtual processor on which a user thread can be scheduled
A kernel thread with reduced privileges
Question 38 of 60
Quiz ID: q38
How does Windows implement threads?
Many-to-One model
Many-to-Many model
One-to-One model
User-level threads only
Question 39 of 60
Quiz ID: q39
What does the ETHREAD structure contain in Windows?
User-mode stack and thread-local storage
Scheduling and synchronization information
Pointer to the process and to KTHREAD
Kernel stack information
Question 40 of 60
Quiz ID: q40
What does the TEB (Thread Environment Block) contain in Windows?
Kernel scheduling information
Thread ID, user-mode stack, and thread-local storage
Pointer to the process
Kernel stack pointer
Question 41 of 60
Quiz ID: q41
How does Linux refer to threads?
As processes
As tasks
As LWPs
As fibers
Question 42 of 60
Quiz ID: q42
How are threads created in Linux?
Using the pthread_create() function
Using the fork() system call
Using the clone() system call
Using the thread_create() system call
Question 43 of 60
Quiz ID: q43
What does the CLONE_VM flag indicate in Linux's clone()?
File system information is shared
The same memory space is shared
Signal handlers are shared
Open files are shared
Question 44 of 60
Quiz ID: q44
What is the main challenge of multicore programming?
Dividing activities and balancing work across cores
Creating enough threads
Eliminating all serial code
Making threads run faster
Question 45 of 60
Quiz ID: q45
What does the term 'scalability' refer to in multithreading?
The ability to create very large threads
The ability to take advantage of multicore architectures
The ability to reduce memory usage
The ability to handle large files
Question 46 of 60
Quiz ID: q46
In the Many-to-Many model, what is the advantage?
It requires no kernel support
It allows the OS to create a sufficient number of kernel threads
It eliminates the need for user-level threads
It is the simplest model to implement
Question 47 of 60
Quiz ID: q47
What is a 'block' in Grand Central Dispatch?
A memory allocation unit
A synchronization primitive
A unit of work enclosed in ^{} syntax
A thread barrier
Question 48 of 60
Quiz ID: q48
What is the default cancellation type in Pthreads?
Asynchronous cancellation
Deferred cancellation
No cancellation
Immediate cancellation
Question 49 of 60
Quiz ID: q49
What is a 'cancellation point' in deferred cancellation?
A point where the thread cannot be canceled
A point where the thread checks if it should be canceled
A point where the thread automatically terminates
A point where the thread changes priority
Question 50 of 60
Quiz ID: q50
How does Java implement thread cancellation?
Using the stop() method
Using the cancel() method
Using the interrupt() method
Using the terminate() method
Question 51 of 60
Quiz ID: q51
What is the relationship between user threads and kernel threads in the One-to-One model?
Many user threads to one kernel thread
One user thread to one kernel thread
One user thread to many kernel threads
Many user threads to many kernel threads
Question 52 of 60
Quiz ID: q52
What is the purpose of the pthread_exit() function?
To create a thread
To terminate the calling thread
To join a thread
To cancel a thread
Question 53 of 60
Quiz ID: q53
What is the difference between extending Thread and implementing Runnable in Java?
Extending Thread is more memory efficient
Implementing Runnable allows the class to extend another class
Extending Thread provides better performance
There is no difference
Question 54 of 60
Quiz ID: q54
What is the key characteristic of a serial dispatch queue in GCD?
Tasks are executed in random order
Tasks are executed in parallel
Tasks are executed in FIFO order, one at a time
Tasks are executed based on priority only
Question 55 of 60
Quiz ID: q55
What is the key characteristic of a concurrent dispatch queue in GCD?
Tasks are executed in random order
Tasks are executed in FIFO order, but multiple tasks may execute concurrently
Tasks are executed one at a time
Tasks are executed based on priority only
Question 56 of 60
Quiz ID: q56
What does the term 'upcall' refer to in scheduler activations?
A call from user space to kernel space
A call from kernel space to user space
A call between user-level threads
A call between kernel threads
Question 57 of 60
Quiz ID: q57
What is the main advantage of the One-to-One model?
It requires no kernel support
It provides more concurrency than Many-to-One
It is simpler to implement
It uses less memory
Question 58 of 60
Quiz ID: q58
What is the main disadvantage of the One-to-One model?
It limits concurrency
It requires more kernel resources, limiting the number of threads
It is more complex to program
It only works on single-core systems
Question 59 of 60
Quiz ID: q59
What is the purpose of the clone() system call in Linux?
To create a new process
To create a new thread with control over what is shared
To clone a file descriptor
To duplicate memory
Question 60 of 60
Quiz ID: q60
What does the CLONE_FILES flag indicate in Linux's clone()?
File system information is shared
The same memory space is shared
Signal handlers are shared
The set of open files is shared
Quiz Summary
Review your answers before submitting
60
Total Questions
0
Answered
60
Remaining
00:00
Time Spent
Submit Quiz
Back to Questions
Previous
Question 1 of 60
Next
!
Confirm Submission
Cancel
Submit Quiz