GATE Daily

Tuesday27 October 2026

Past sets27 Oct 2026OS

Processes, threads and system calls: GATE CS question with solution

Q.8

A single process has several threads. Which of the following are shared by all the threads of this process?

One try. It counts in your 27 Oct 2026 set.
Show solution
RememberThreads of one process share the address space (code, globals, heap) and OS resources such as open files; each thread has its own program counter, registers and stack.

Solution MSQ · 1 mark · no negative marking

Answer: (A) Global variables in the data segment; (C) The table of open file descriptors

Method. Split the state into what belongs to the process and what belongs to each thread of execution.

  • Per process (shared by its threads): the address space (code, global/static data, heap), open files, and other OS resources.
  • Per thread (private): program counter, registers, stack pointer and the stack itself, thread state.

So globals (a) and the open-file table (c) are shared; the stack pointer (b) and register contents (d) are not.

The trap. The stack is in the shared address space, so another thread could reach it through a pointer; but each thread has its own stack and its own stack pointer value. "Shared address space" does not mean "shared execution context".

What was tested. The basic thread/process split: a thread is an execution context (PC, registers, stack) running inside a process's shared resources.

Copied. Paste it into the new chat.Too long to send. Copy the question and solution by hand.