Quiz 3 Flashcards

1
Q

T/F: Concurrency means that several tasks run at the same time interval. Parallelism means that several tasks run at the same instant time

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

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

A

If one thread fails with an error/exception and is not managed, the whole process will fail.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

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.

A
  • The kernel-level threads can be managed by the user.
  • The OS can schedule the kernel-level threads.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

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;
}

A

100

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

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

A thread can create one or more processes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

T/F: Only threads can block independently from one another.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

___ is the default thread cancellation type for threads

A

defferred

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

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?

A

asynchronous

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

In the Many to One model, multiple threads are unable to run in parallel on multiprocessors because

A

only one thread can access the kernel at a time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

T/F : Threads are faster to create and destroy than processes.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

T/F: In a multi-threaded process, the PCB is replaced by multiple TCBs.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Using n threads within a single process is more efficient than using n separate processes because

A

the threads share the same code and data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

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?

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

In the Many-to-One model, multiple threads are unable to run in parallel on multiprocessors because

A

only one thread can access the kernel at a time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

what is the drawback of the One-to-One Model?

A

creating a user thread requires creating the corresponding kernel thread

How well did you know this?
1
Not at all
2
3
4
5
Perfectly