What is the basic difference between threads and processes? , JAVA Programming

A process is an execution of a code but a thread is a single execution sequence within the process. A process may contain multiple threads. A thread is sometimes named a lightweight process.

 

1220_Untitled.png

 

A JVM runs in a single threads and application in a JVM share the heap belonging to that process. That is why various threads may access the same object. Threads share the heap and have their own stack memory space. This is how one thread's call of a method and its local variables are remain thread safe from other threads. But the heap is not thread-safe and has to be synchronized for thread safety.

 

Posted Date: 7/25/2012 2:59:08 AM | Location : United States







Related Discussions:- What is the basic difference between threads and processes? , Assignment Help, Ask Question on What is the basic difference between threads and processes? , Get Answer, Expert's Help, What is the basic difference between threads and processes? Discussions

Write discussion on What is the basic difference between threads and processes?
Your posts are moderated
Related Questions
i need a quote on java assignment carlosfreire3@hotmail.com

SQLWarning objects are a subclass of SQLException that deal with database access warnings. Warnings do not stop the implementation of an application, as exceptions do; they easily

What are the advantages that Java's layout managers provide over traditional windowing systems ?

How to write a program that converts US dollars into Canadian dollars.The program let the user enter an amount in US dollars and display it equivalent value in Canadian dollars whe

How to Creating Arrays in java? Declaring arrays merely says what type of values the array will hold. It does not form them. Java arrays are objects, and such as any other obje

A point-to-point model is based on the concept of a message queue: Senders send messages into the queue, and the receiver reads messages from this queue. In the point-to-point mode

1. Unit tests :There are two popular processes to testing server-side classes: mock objects, which test classes by checking the server container, and in-container testing, which

Im not in the line of computer science.But i would like to have some knowledge about the computer language "JAVA".I aldredy learns the computer languages "C,C++".So kindly help me

I need GPA calculating application Project Description: My project is one of the GPA calculating application, Colleges have 37 courses or departments, engineering results alw

Hospital Management System: Technology Used Java-JSP, Apache Tomcat (webserver), SQL SERVER 2000. This project is aimed at developing a web-based system for taking records