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
Need to Insert Admob Code Into Android Application Project Description: We are seeking Android developer to add Admob code in to our application. It should be very simple

When wiring beans, if a bean element is embedded to a property tag directly, then that bean is said to the Inner Bean. The disadvantage of this bean is that it cannot be reused any

JMS ((java messaging service))is an acronym used for Java Messaging Service. It is Java's answer to formed software using asynchronous messaging. It is one of the official specific

A Padovan string P(n) for a natural number n is defined as: P(0)=''X'' P(1)=''Y'' P(2)=''Z'' for a string characters ''X'',''Y'',''Z'' only,and given value of n,write a program th

What are the kinds of computer network according to the distance among nodes? the kinds of computer network according to the distance among nodes are as follows: There are t

please help please help please help please help please help please helpplease help please help

What can you do with an exception once you've caught it? 1. Fix the difficulty and try again. 2. Do anything else instead. 3. Exit the application along with System.exit() 4

I want cyclos mobile banking USSD and IVR module Project Description: We already have a Cyclos mobile banking project deployed on our server with SMS banking module. The s

Explain the term array and Scope of Variable? Defining the space in that a variable is effective is known as describing the scope of a variable. A variable can be either local

how i made a calculator in java plz tell help me