Multithreaded programming


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


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.


Heap memory and global variables are shared across the threads