
25 Apr
2008
25 Apr
'08
7:02 a.m.
On Fri, Apr 25, 2008 at 5:08 AM, shiwei xu <xushiweizh@gmail.com> wrote:
I don't think shared ownership is a requirement. It is only a memory management technique. Why don't Java programmers care such a question?
They don't care because it is solved by the virtual machine. Dividing available memory into per-thread blocks and allocating from there avoids the need for a lock mechanism on each allocation. That does not mean that memory is not shared among threads, only that empty space is not shared. Memory is actually shared among threads. In Java shared ownership is not a requirement, it is a fact. Garbage collector does not consider which thread has what references, only that there are references to the object. David