Re: [Sablevm-developer] question about _svmf_stop_the_world()
Brought to you by:
egagnon
From: Prof. E. M. G. <eti...@uq...> - 2003-03-31 13:44:47
|
Hi Archie, You can view vm->pending_halt_thread_count as the count of Java threads (non-JNI) that have not yet reached a GC check point since GC was requested. So, when a Java thread reaches a GC point, it decreases this count and goes to sleep. When the count reaches 0, the GC thread is awaken and GC proceeds. As you probably know, a sleeping thread can be awaken for many reasons, yet it is important that any Java thread at GC point goes back to sleep if it is awaken before GC is done. As the thread is already at a GC point, the count is not modified. As for JNI threads, as you correctly deduced, they cannot prevent GC, so a count is not needed (the count is used to awaken the GC thread and start GC). I know, this deserves *at least* a technical report. I'll evetually one that describe the whole algorithm, when I get some time. Etienne Archie Cobbs wrote: > Archie Cobbs wrote: > >>Why in _svmf_stop_the_world() do you increase "vm->pending_halt_thread_count" >>for threads in state SVM_THREAD_STATUS_RUNNING_JAVA threads but not for >>threads in state SVM_THREAD_STATUS_NOT_RUNNING_JAVA_RESUMING_ALLOWED? > > > Ah.. now I think I see it.. > > It's because a thread's Java stack and its list of local native > references (in fact, it's total Java state) cannot change while > executing native code outside of libsablevm, because all JNI calls > that would permit such a thread to modify its Java state begin with > "_svmf_resuming_java()". So we can assume such threads are "halted" > even if they're still executing.. and if they attempt to cross back > into 'JAVA' mode they will see that resuming is disabled and then > they will halt. > > Does this sound correct? > > Thanks, > -Archie > > __________________________________________________________________________ > Archie Cobbs * Precision I/O * http://www.precisionio.com > > > ------------------------------------------------------- > This SF.net email is sponsored by: > The Definitive IT and Networking Event. Be There! > NetWorld+Interop Las Vegas 2003 -- Register today! > http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en > _______________________________________________ > Sablevm-developer mailing list > Sab...@li... > https://lists.sourceforge.net/lists/listinfo/sablevm-developer > > -- Etienne M. Gagnon, Ph.D. http://www.info.uqam.ca/~egagnon/ SableVM: http://www.sablevm.org/ SableCC: http://www.sablecc.org/ |