In-class activity 2 Flashcards

1
Q

Which of the following resources are shared among threads in a process
a. program counter
b. stack
c. heap
d. registers

A
  • heap
    threads have their own program counter, registers and stack
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

how do you terminate a multi-threaded process without changing the source code

A

there is no way to terminate a thread from a process

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

is it possible to run multi-threaded (user-level) programs on multiple processors in parallel

A

no, because the kernel in unaware of the threads in the code. Scheduling of user-level threads in handled on a software level

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

With a multi-threaded process, each TCB maintains a separate copy of the thread state (running, ready, or blocked), but the PCB must also have a copy of the process state (running, ready, or blocked).
a) Only with user-level threads
b) Only with kernel-level threads
c) Aways
d) Never

A
  • only with user-level threads
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Is it necessary for threads in a process to have separate stacks?

A

Yes, so they can have a separate execution state and run independently

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