Quiz 3 Flashcards
T/F: Concurrency means that several tasks run at the same time interval. Parallelism means that several tasks run at the same instant time
True
Which of the following statements is not correct about threads and processes:
- Switching between processes is cheaper than switching between threads within a process.
- If one thread fails with an error/exception and is not managed, the whole process will fail.
- The address space of a process is shared among all its thread
If one thread fails with an error/exception and is not managed, the whole process will fail.
Which of the following statements are correct:
- If a user-level thread is waiting for I/O, the entire process will wait.
- The kernel-level threads can be managed by the user.
- The OS can schedule the kernel-level threads.
- The OS can schedule the user-level threads.
- The kernel-level threads can be managed by the user.
- The OS can schedule the kernel-level threads.
Assume we have a global variable total initialized as 0. Two threads are executing addFifty() concurrently. What is the value of total when both threads finish their execution?
int total = 0;
void *addFifty() {
for (int i = 0; i < 50; i++)
total += 1;
}
100
Which of the following statements is not correct:
- A process can create one or more processes.
- A thread can create one or more processes.
- A process can create one or more threads.
A thread can create one or more processes.
T/F: Only threads can block independently from one another.
False
___ is the default thread cancellation type for threads
defferred
In a web server that uses multithreading to continuously listen to user requests as well as handle each individual request simultaneously, will you prefer using synchronous or asynchronous threading strategies?
asynchronous
In the Many to One model, multiple threads are unable to run in parallel on multiprocessors because
only one thread can access the kernel at a time
T/F : Threads are faster to create and destroy than processes.
True
T/F: In a multi-threaded process, the PCB is replaced by multiple TCBs.
False
Using n threads within a single process is more efficient than using n separate processes because
the threads share the same code and data
T/F: Consider N threads in a process. If one thread passes certain arguments to a function in the program, are these arguments visible to the other threads?
False
In the Many-to-One model, multiple threads are unable to run in parallel on multiprocessors because
only one thread can access the kernel at a time
what is the drawback of the One-to-One Model?
creating a user thread requires creating the corresponding kernel thread