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
Wechat and SugarCRM Project Description: Seeking the partner able to develop wechat program to integrate with SugarCRM. Wechat Official Account able to perform some functi

State the significance of public, private, protected, default modifiers both singly and in combination and state the effect of package relationships on declared items qualified by


iiiiii

J2EE Java Website rebuild Project Description: We are seeking an experienced developer to re-build a Java/J2EE based Website. We are in requirement to reconstruct our website

Why uploading a web page is important? Describe in 2 - 3 lines? Through only uploading webpage we could place our data so that another can reach up to what we have loaded. Uplo

To use the DispatchAction, follow these steps: ? Make a class that extends DispatchAction (instead of Action) ? In a new class, add a method for each function you need to per

Question 4 Write a program that receives two integer inputs from a user, an ending value, lastvalue and column, column. The program will display all numbers from 1 to lastvalue


Explain the Execute phase of Java Program Development Finally in phase computer, under the control of its CPU, interprets program one bytecode at a time. Hence performing