27 votes 27 votes Which one of the following is NOT shared by the threads of the same process ? Stack Address Space File Descriptor Table Message Queue Operating System gateit-2004 operating-system easy threads + – Ishrat Jahan asked Nov 1, 2014 Ishrat Jahan 13.8k views answer comment Share Follow See all 2 Comments See all 2 2 Comments reply Dileep kumar M 6 commented Dec 5, 2017 reply Follow Share Threads don't share stack, program counter and registers, shares code, data, heap and files. 11 votes 11 votes hacker16 commented Apr 18, 2018 reply Follow Share what do they mean by message queue? 4 votes 4 votes Please log in or register to add a comment.
Best answer 30 votes 30 votes Stack is not shared Sankaranarayanan P.N answered Nov 18, 2014 selected Jan 8, 2015 by Arjun Sankaranarayanan P.N comment Share Follow See all 5 Comments See all 5 5 Comments reply Show 2 previous comments abhijit commented Sep 16, 2017 reply Follow Share It is true that each thread has it's own stack and program counter. But threads are not independent on each other. Because all threads can access every address in the task, a thread can read or write every other thread's stack. Taken from Galvin chapter 4(Thread Structure - Para 4) So can someone please explain if it has anything to do with same or different process? 2 votes 2 votes Sankaranarayanan P.N commented Oct 5, 2017 reply Follow Share No. It can access its own stack 0 votes 0 votes Suneel Padala commented Dec 20, 2018 reply Follow Share @Sankaranarayanan P.N can please explain what is message queue? 0 votes 0 votes Please log in or register to add a comment.
12 votes 12 votes Threads Share Code Data File Descriptor table Address spaces Message Queue heap gloabal varaibles accounting information these things are shared as two threads of the same process are doing same kind of work on different instances and these things don’t get changed while they are doing the task Threads don’t Share Registers program counter Stack During performing a task above things get changed so they are not shared by threads takeaway: Things which will get changed while a task is performed and may affect other task if we use them for other task too cannot be shared. Answer(A) Stack Musa answered Nov 2, 2020 edited Nov 2, 2020 by Musa Musa comment Share Follow See all 0 reply Please log in or register to add a comment.
10 votes 10 votes Threads have their own stack and registers , although resources like code , data , files and memory is shared. Divya Soni answered Apr 2, 2017 Divya Soni comment Share Follow See all 0 reply Please log in or register to add a comment.
4 votes 4 votes Stack,program counter and register is not shared by thread. So A is the answer. sudhir singh answered Dec 16, 2017 sudhir singh comment Share Follow See 1 comment See all 1 1 comment reply saumya mishra commented Sep 27, 2018 reply Follow Share How is file descriptor table and message queue related to threads?? 1 votes 1 votes Please log in or register to add a comment.