36 36 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 20.3k views answer comment Share Follow Print See all 4 Comments 4 4 Comments reply Dileep kumar M 6 commented Dec 5, 2017 reply Follow flag Threads don't share stack, program counter and registers, shares code, data, heap and files. 15 15 replyShare hacker16 commented Apr 18, 2018 reply Follow flag what do they mean by message queue? 4 4 replyShare ashishtomarx commented Apr 19, 2024 reply Follow flag From Tanenbaum: 8 8 replyShare om_30 commented Jun 12 reply Follow flag Option A 3 3 replyShare Please log in or register to add a comment.
Best answer 38 38 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 5 5 Comments reply Show 2 previous comments abhijit commented Sep 16, 2017 reply Follow flag 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 2 replyShare Sankaranarayanan P.N commented Oct 5, 2017 reply Follow flag No. It can access its own stack 0 0 replyShare Suneel Padala commented Dec 20, 2018 reply Follow flag @Sankaranarayanan P.N can please explain what is message queue? 0 0 replyShare Please log in or register to add a comment.
19 19 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 0 reply Please log in or register to add a comment.
10 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 0 reply Please log in or register to add a comment.
4 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 1 1 comment reply saumya mishra commented Sep 27, 2018 reply Follow flag How is file descriptor table and message queue related to threads?? 1 1 replyShare Please log in or register to add a comment.
1 1 vote Explanation of Each Option:Stack:Not shared by threads.Each thread has its own private stack to store function calls, local variables, and return addresses. This separation is necessary to allow independent execution of threads without interfering with each other's function calls and variables.Address Space:Shared by all threads within the same process.Threads share the same memory space, including the code, heap, and global variables.File Descriptor Table:Shared by all threads.Threads can access and modify the same file descriptors, as these are part of the process's shared resources.Message Queue:Shared if implemented within the process's shared memory space.Message queues created for inter-thread communication are typically accessible to all threads within the same process.correct option is A More on FILE DESCRIPTOR TABLE: The File Descriptor Table is a data structure maintained by the operating system for each process. It tracks open files and I/O resources (e.g., sockets, pipes) associated with a process. This table is crucial for facilitating file operations such as reading, writing, and closing files. surya_siddina answered Dec 7, 2024 surya_siddina comment Share Follow 0 reply Please log in or register to add a comment.