Is there a separate stack for each thread in Java

Showing Answers 1 - 23 of 23 Answers

Senthilrajan

  • Jun 17th, 2005
 

No 
 
Thanks 
 
regards 
 
K.Senthilrajan

  Was this answer useful?  Yes

Shailesh

  • Aug 1st, 2005
 

No..thread share common memory area....so there is no seprate stack for each thread.... 
 
Thanks 
Shailesh

  Was this answer useful?  Yes

Vivek

  • Aug 1st, 2005
 

Yes, there are seperate stacks. Threads share memory area, but have different stacks.  
http://www.particle.kth.se/~lindsey/JavaCourse/Book/Part1/Supplements/Chapter08/processorView.html

Sisodiya Pramod

  • Aug 16th, 2005
 

Yes, threads use the seprate stack, because thread data may have different value of sharable threads.

  Was this answer useful?  Yes

pavan

  • Sep 2nd, 2005
 

nice link Vivek. Thank You

  Was this answer useful?  Yes

Yash Garg

  • Sep 11th, 2005
 

Yes. Every thread mentains its own separate stack, called Runtime Stack. Elements of the stack are the method invocations, called activation record or stack frame. The activation record contains pertinent information about a method like local variables.

  Was this answer useful?  Yes

Srinivas Rao

  • Jan 17th, 2006
 

Thanks Vivek u r really done Good Job ,

Great Keep it Up.

  Was this answer useful?  Yes

vivek jain

  • Apr 14th, 2006
 

well done vivek!!!!!!

  Was this answer useful?  Yes

hannarani

  • Apr 3rd, 2008
 

Yes. Every thread maintains its own separate stack, called Runtime Stack but they share the same memory. Elements of the stack are the method invocations,
called activation records or stack frame. The activation record contains pertinent information about a method like local variables.

Sandip shelke

  • Aug 10th, 2015
 

Yes there is separate stack for each thread.
Bcoz suppose i have created two thread & I am writing a for loop in run method
which incrment from 1 to 10
void run()
{
for(int i=1;i<10;i++)
{
System.out.println(i);
}
}
then op will be anything like
1
1
2
2
3
3
etc
therefore we can say there is separate stack for this local values of i which will changes from current value not from again 1.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions