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
1.) Write an application with two user transactions (login which includes viewAllStudents and viewStudent ) with full MVC architecture that displays the details of the selected

Question 1 What is Response Redirection? Explain in brief Question 2 What is JDBC? Explain Question 3 Write a short note on Expressions Question 4 What is an XML na

Printing Calculator Canvas Printing Calculator In this assignment we will continue to work on our canvas printing web service. Specifically we will make use of Javascrip


Objectives 1.      To design and implement a simple class. 2.      To write a test program to create instances of your class and demonstrate its behaviour. 3.      To col

The == gives true, if the variable reference points to the similar types of object in memory. That is a " shallow comparison ".   The equals () - gives the results of run

Normal 0 false false false EN-US X-NONE X-NONE

GPS and GPRS fleet management system Project Description: I want to develop fleet management system Skills required: HTML, PHP, Java, Website Design

Ask1. Storing the Array: Write an application that uses an Array to store 10messages of type String. You will store this Array with 10 messages of your choosing. For example, a mes