Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is the difference between Process and Threads?

Answer Posted / hetal

A process is a running instance of a program to which system allocates resources like CPU time and memory (separate heap, method area etc. which does not overlap with other process running on the system at the same time). In a big application there may be a set of cooperating processes communicating to each other in order to perform the desired functionality. Two processes communicate through well defined inter process communication mechanism, such as pipes, sockets and shared memory, if both processes are running on the same machine.

On the other hand threads exist within a process; every process has at least one thread. A thread is a light weight process that does not require as much resources as a process requires. Threads running inside a process, share the common set of resources among themselves which are allocated to the process (including the memory, the address space). All the threads share the same heap and method area (but individual stacks). All local variables are thread safe in Java because local variables are stored in each thread's own stack and each thread has its own stack created. Because threads share virtual address space, that makes inter thread communication between threads much cheaper than inter process communication between two independent processes

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Java is fully object oriented languages or not?

1074


Is there a guarantee of uniqueness for entity beans?

1059


Can I have an action without a form?

1163


Can you give me a simple example of using the requiredif validator rule?

1184


What if the static modifier is removed from the signature of the main method?

1305


When a thread blocks on i/o?

1170


In inglish: How to convert jar to exe files? Em português: Como converter arquivos .jar para .exe?

2711


What is a sessionfactory? Is it a thread-safe object?

1265


What are JTA/JTS and how they used by client?

2266


What are the different approaches to represent an inheritance hierarchy?

1117


Explain ioc concept?

1197


What is chat area? Explain.

1068


What is the argument type of a programs main() method?

1169


What are callback interfaces?

1138


What is the diffrence between a local-tx-datasource and a xa-datasource? Can you use transactions in both?

1086