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 to get how to start the java program to evaluate the simillarity.

Instructions: Please make sure your solutions are original, in your own words, expressing your own ideas. Any copying from others' home-works, text books or online sources will

Looking for: responsible, trustworthy, accountable, and knowledgeable CakePHP developer and web designer with great communication skills. I'm seeking great partnership and if th

Model-View-Controller (MVC) is a design pattern put together to help control change. MVC decouples interface from business logic and data. ? Model: The model having the core of

write code employe managment

What does TCP/IP stand for? TCP/IP is a Protocol type basically it is known by Transmission Control Protocol/Internet Protocol

Struts is a set of cooperating classes, servlets, and JSP tags that make up a reusable MVC 2 design. ? JavaBeans components for managing application state and behavior. ? Eve

java code for finding area under curve y=f(x) between x=a and a=b integrate y=f(x) between the li,its of a and b. the area under a curve between two points can be found by doing a

What will be the output of this programme? Write comments where you find "//" symbol in the following code? function doSomething() { // 1 setTimeout('doSomething()',10000

What Can an Applet Do? An applet can: • Draw pictures on a web page • Create a new window and draw in it. • Play sounds. • Receive input from the user by the keyboard or