Multithreaded programming


#1

Which of the following components of program state are shared across threads in a multithreaded process?
a. Register values
b. Heap Memory
c. Global variables
d. Stack Memory


#2

A Thread is comprised of a thread ID, a program counter, a register set and a stack. In a multi-threaded process each thread owns private registers and private stack segments. They share the heap, global memory.

So, (b) Heap Memory & © Global variables options are correct.


#3

Heap memory and global variables are shared across the threads