The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
+25 votes

A thread is usually defined as a light weight process because an Operating System (OS) maintains smaller data structure for a thread than for a process. In relation to this, which of the following statement is correct?

  1. OS maintains only scheduling and accounting information for each thread
  2. OS maintains only CPU registers for each thread
  3. OS does not maintain virtual memory state for each thread
  4. OS does not maintain a separate stack for each thread
asked in Operating System by Veteran (105k points)
recategorized by | 3.6k views
if in answer only is not there then what is answer A or C
both will be true
in exam, which option more apropriate becoz there is only one option
what are you asking? "only" removed from question option?
my question is that if in option A we remove only word then whats the appropriate answer
Options C. and D. are shuffled in GateOverflow october 2016  Book.
in full length test, it is given-B plz take a note of it!
Plz confirm answer is B or C ?
you can see selected ans as 'c '.
yes options c and d are shuffled in GO 2016

In this question it is not clear they are talking about User Level Thread or Kernel Level Thread.

With respect to User Level Thread answer (C) looks OK. But provided explanation are not LGTM.

ping @Ashwin Kulkarnipavan singh and Red_devil.

2 Answers

+56 votes
Best answer

Answer to this question is (C).

Many of you would not agree at first So here I explain it how.

OS , on per thread basis, maintains ONLY TWO things : CPU Register state and Stack space. It does not maintain anything else for individual thread. Code segment and Global variables are shared. Even TLB and Page Tables are also shared since they belong to same process.

  1. option (A) would have been correct if 'ONLY' word were not there. It NOT only maintains register state BUT stack space also.
  2. is obviously FALSE
  3. is TRUE as it says that OS does not maintain VIRTUAL Memory state for individual thread which isTRUE
  4. This is also FALSE.
answered by Loyal (7.7k points)
edited by
yes i got c too

thw word "only" was bugging me
can you explain something about scheduling and accounting information..what does it include?


i think you have hiven explanatio for D and C is false

correct me if wrong

I think somebody edited the ques plz edit the ans also...its conflicting @Arjun sir
What is the meaning of virtual memory state??
accounting information is the information related to the amount of cpu time the thread or process has utilised till that instance this is not maintaned per thread basis it is maintained as basis of process per process in PCB
But option A is about Scheduling and Accounting information, not about Stack and registers... Please explain about option A

The explanation for the first option is not right. Not sure about scheduling, but accounting information is maintained per process (one for all threads, not each thread). I don't know why you compared it with registers and stack. And thus, false.

And also, thread control block not only maintains stack and register pointers but also register state and program counter. And to be more precise, it also contains a PCB pointer. Please don't misguide people.

@warlock agreed with you!

somebody edited the question

the options got shuffled i guess......what is explained as Option A is actually meant for option B i guess
I think the virtual memory state is the if a thread wants to access a page of the process it uses the mappings the page tables and the TLB every process has its own page table hence we dont need a seperate page table per thread  correct me if i am wrong @Arjun sir

threads maintain separately for individual threads only two things _ stack and registers

@A_i_$_h  that  is what i was saying threads can share global variables in code(data segment) and the code segment and the heap segment of a process they have their own register file, stack, and Program counter  

Small correction here - Each thread will have Program Counter, stack and register seperately.
@Lokesh i think what they mean by virtual memory state is the virtual address space. Since each process has it's own Virtual Address Space, all threads of that process will share that space.
Consider like this-If each process in the system has 100 threads, if OS maintains per thread virtual memory information, then it will much larger overhead than maintaining virtual mem info for processes.Hence option (C) looks suitable.
0 votes

THIS MIGHT HELPthis might help

answered by (163 points)

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

42,583 questions
48,570 answers
63,603 users