edited by
2,404 views
3 votes
3 votes

Which of the following are NOT shared by the threads of the same process?

  1. Stack
  2. Registers
  3. Address space
  4. Message queue
  1. a and d
  2. b and c
  3. a and b
  4. a, b and c
edited by

2 Answers

3 votes
3 votes
Stack and Registers are not shared by threads of same process.

Threads can not share stack (used for maintaining function calls) as they may have their individual function call sequence.
0 votes
0 votes

In general each thread has its own registers (including its own program counter), its own stack pointer, and its own stack. Everything else is shared between the threads sharing a process.

Why registers cannot be shared?

Each thread needs its own program counter value. (which is a register)

Why stack cannot be shared?

Each thread may have its own calling sequence.

So, C. Stacks and Registers is correct.

Ref: https://cs.stackexchange.com/questions/48345/what-threads-share-in-general

Answer:

Related questions

1 votes
1 votes
1 answer
1
3 votes
3 votes
3 answers
3
Arjun asked Jul 2, 2019
1,904 views
Match List-I with List-II:$$\begin{array}{|c|c|c|c|} \hline {}& \text{List-I} & {} & \text{List-II} \\ \hline (a) & \text{Disk} & (i) & \text{Thread} \\ \hline (b) & \te...