Re: [Sablevm-developer] Why can't we do gc without synchronization?
Brought to you by:
egagnon
From: Etienne G. <gag...@UQ...> - 2004-03-26 14:33:04
|
canning yuan wrote: > if we allocate loal heap for each thread for reducing synchronization. > why we can't do gc for each thread instead of stoping the world? Because the references to objects are propagated to other threads in Java programs, so it would be unsafe to move objects while other threads are possibly modifying these same objects at their "old" location. Do not forget that SableVM's garbage collector moves objects around; this must be done in a "stop-the-world" state (unless one implements some more complex protocol using what is called "read and write barriers"). Etienne -- Etienne M. Gagnon, Ph.D. http://www.info.uqam.ca/~egagnon/ SableVM: http://www.sablevm.org/ SableCC: http://www.sablecc.org/ |