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

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
+1
0
if in answer only is not there then what is answer A or C
0
both will be true
0
in exam, which option more apropriate becoz there is only one option
0
what are you asking? "only" removed from question option?
0
my question is that if in option A we remove only word then whats the appropriate answer
+1
Options C. and D. are shuffled in GateOverflow october 2016  Book.
0
in full length test, it is given-B plz take a note of it!
0
Plz confirm answer is B or C ?
0
you can see selected ans as 'c '.
+1
yes options c and d are shuffled in GO 2016
0

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
0
yes i got c too

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

@Sandeep_Uniyal

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

correct me if wrong

+2
I think somebody edited the ques plz edit the ans also...its conflicting @Arjun sir
+3
What is the meaning of virtual memory state??
0
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
0
But option A is about Scheduling and Accounting information, not about Stack and registers... Please explain about option A
+5

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.

0
@warlock agreed with you!
0
@warlock

somebody edited the question

the options got shuffled i guess......what is explained as Option A is actually meant for option B i guess
0
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
0
@venkat

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

@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  

+2
Small correction here - Each thread will have Program Counter, stack and register seperately.
0
@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.
0
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)
Answer:

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
155,489 comments
63,603 users