On Saturday, April 23, 2011 8:50:51 PM UTC+10, Phil wrote:
>
> Hmm, I can't see that working, as the stack for one thread will not be 
> available to others. The optimiser would have to satisfy itself that 
> such an object was only accessible by one thread at a time, and it 
> would have to move the object around between stacks as the parent came 
> into scope in different threads. Heap sounds safer, simpler and more 
> performant. 
>  


Naturally the problem with putting stuff on the stack is what to do if the 
reference escapes and needs to be used by another thread or perhaps what if 
it hangs around forever, but that frame with those values is popped after 
lots of method returns. However if your creating short term objects and just 
passing them methods then it does seem to make sense.

-- 
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en.

Reply via email to