Hi everyone,
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?
canning
---------------------------------
Do You Yahoo!?
完全免费的雅虎电邮,马上注册获赠额外60兆网络存储空间
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/