The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+28 votes
4.3k 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 (115k points)
recategorized by | 4.3k 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

+61 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?
+3

@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
+7

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
+1
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

@Ayush Upadhyaya

@Shaik Masthan

OS maintains per process vitrual memory state  i.e Virtual address space ..All the threads of a process shares that address space..

Per thread OS maintains registers , stack , program counter , pointer to parent PCB , scheduling info(in case of kernel level thread whose scheduling done by kernel) not sure about last one

What is accounting info of process?

0

@jatin khachane 1-Accounting info is like how much cpu time process has used, what I/O devices are held or used by the process all those information that tells how much the process is using what resource of the computer.

+2 votes

THIS MIGHT HELPthis might help

answered by Junior (697 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
47,910 questions
52,287 answers
182,227 comments
67,728 users