recategorized by
17,044 views
54 votes
54 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
recategorized by

3 Answers

Best answer
103 votes
103 votes

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.
edited by
27 votes
27 votes

From Tanenbaum,

 

The items in the first column are process properties, not thread properties. For example, if one thread opens a file, that file is visible to the other threads in the process and they can read and write it. This is logical, since the process is the unit of resource management, not the thread. If each thread had its own address space, open files, pending alarms, and so on, it would be a separate process. What we are trying to achieve with the thread concept is the ability for multiple threads of execution to share a set of resources so that they can work together closely to perform some task.

Answer:

Related questions