3 votes 3 votes Which of the following are NOT shared by the threads of the same process? Stack Registers Address space Message queue a and d b and c a and b a, b and c Operating System ugcnetcse-june2019-paper2 threads + – Arjun asked Jul 2, 2019 • edited Jul 23, 2019 by Lakshman Bhaiya Arjun 2.4k views answer comment Share Follow See all 5 Comments See all 5 5 Comments reply Show 2 previous comments smsubham commented Dec 19, 2019 reply Follow Share 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 0 votes 0 votes commenter commenter commented Dec 31, 2019 reply Follow Share What is message queue? 0 votes 0 votes Sanandan commented Aug 29, 2020 reply Follow Share option c 0 votes 0 votes Please log in or register to add a comment.
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. Aman_Singh answered Jul 3, 2019 Aman_Singh comment Share Follow See 1 comment See all 1 1 comment reply `JEET commented Oct 23, 2019 reply Follow Share @Aman_Singh You didn't explain the reason for registers? 0 votes 0 votes Please log in or register to add a comment.
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 smsubham answered Dec 19, 2019 smsubham comment Share Follow See all 0 reply Please log in or register to add a comment.