In-class activity 2 Flashcards
Which of the following resources are shared among threads in a process
a. program counter
b. stack
c. heap
d. registers
- heap
threads have their own program counter, registers and stack
how do you terminate a multi-threaded process without changing the source code
there is no way to terminate a thread from a process
is it possible to run multi-threaded (user-level) programs on multiple processors in parallel
no, because the kernel in unaware of the threads in the code. Scheduling of user-level threads in handled on a software level
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
- only with user-level threads
Is it necessary for threads in a process to have separate stacks?
Yes, so they can have a separate execution state and run independently