20,327 views
36 36 votes

Which one of the following is NOT shared by the threads of the same process ?

  1. Stack
  2. Address Space
  3. File Descriptor Table
  4. Message Queue

5 Answers

Best answer
38 38 votes
Stack is not shared
selected by
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

edited by
10 10 votes
Threads have their own stack and registers , although resources like code , data , files and memory is shared.
1 1 vote

Explanation of Each Option:

  1. 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.
  2. Address Space:

    • Shared by all threads within the same process.
    • Threads share the same memory space, including the code, heap, and global variables.
  3. 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.
  4. 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.

Answer:
Position:
Show:

Related questions

48 48 votes
7 answers 7 answers
18.2k
18.2k views
Ishrat Jahan asked Nov 2, 2014
18,226 views
A process executes the following segment of code :for(i = 1; i <= n; i++) fork ();The number of new processes created is$n$$((n(n + 1))/2)$$2^n - 1$$3^n - 1$
18 18 votes
2 answers 2 answers
13.4k
13.4k views
Ishrat Jahan asked Nov 1, 2014
13,361 views
What is the bit rate of a video terminal unit with $80$ characters/line, $8$ $\text{bits/character}$ and horizontal sweep time of $100$ $\text{µs}$ (including $20$ $\text...
32 32 votes
8 answers 8 answers
10.3k
10.3k views
Ishrat Jahan asked Nov 2, 2014
10,251 views
In the TCP/IP protocol suite, which one of the following is NOT part of the IP header?Fragment OffsetSource IP addressDestination IP addressDestination port number
56 56 votes
6 answers 6 answers
19.2k
19.2k views
Ishrat Jahan asked Nov 2, 2014
19,199 views
Consider the following C program which is supposed to compute the transpose of a given $4 \times 4$ matrix $M$. Note that, there is an $X$ in the program which indicates ...