ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories  >>  Software  >>  Operating Systems  >>  Windows  >>  SDK
 
 


 

 
 SDK interview questions  SDK Interview Questions
 Windows Threads interview questions  Windows Threads Interview Questions
 Windows AllOther interview questions  Windows AllOther Interview Questions
Question
List reasons why a Mode switch between threads may be 
cheaper than a Mode switch between processes?

 Question Submitted By :: Roshan G. Subba
I also faced this Question!!     Rank Answer Posted By  
 
  Re: List reasons why a Mode switch between threads may be cheaper than a Mode switch between processes?
Answer
# 1
1. reason – the control blocks for processes are larger 
than for threads (hold more state information), so the 
amount of information to move during the thread switching 
is less than for process context switching
2. reason – the major reason is that the memory management 
is much simpler for threads than for processes. Threads 
share their memory so during mode switching, memory 
information does not have to be exchanged/changed, pages 
and page tables do not have to be switched, etc. This makes 
the thread context switch much cheaper than for processes. 
In case of processes the memory pieces (pages) need to be 
exchanged, etc. (Will talk about the details in few weeks).
3. reason – threads do not have to worry about accounting, 
etc, so do not have to fill out all the information about 
accounting and other process specific information in their 
thread control block, so keeping the thread control block 
consistent is much faster
4. reason – threads share files, so when mode switch 
happens in threads, these information stay the same and 
threads do not have to worry about it (similar to 
accounting information) and that makes the mode switch much 
faster.
 
Is This Answer Correct ?    0 Yes 0 No
Yo
 
  Re: List reasons why a Mode switch between threads may be cheaper than a Mode switch between processes?
Answer
# 2
Process :Generally heavy weight by, the PCB holds kernel
objects the values generally referred as state information.

A application can be divided into two types in design phase:

1.Process - may affect application/program architecture
2.Threads - didn't affect architecture

Threads typically are spawned for a short-term benefit where
as process for long-term even the thread share its own
process address space is never larger than 4GB.

A single process may hold "n" threads so exchanging value
between process; then the cpu spend most of its time for
swapping it leads to thrasing definitely.


Threads easily exchange their locale variables within its
scope but exchange value between process stolen more cpu cycles.
 
Is This Answer Correct ?    0 Yes 0 No
Nirmalraj
 
 
 

 
 
 
Other SDK Interview Questions
 
  Question Asked @ Answers
 
what is difference between fat & ntfs Polaris8
What is the difference among deadlock avoidance, detection and prevention?  1
API used to hide window TCS2
List reasons why a Mode switch between threads may be cheaper than a Mode switch between processes?  2
Write short note on Dynamic memory allocation algorithm.  1
Which file system allow as much fragmentation FAT32 or NTFS?  1
can you create con folder in windows, if not why?  3
what is FAT?. Mascot4
what is the operating system of mac?  2
 
For more SDK Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com