Re: [Sablevm-developer] Question about _svmf_stopping_java()
Brought to you by:
egagnon
From: Archie C. <ar...@de...> - 2004-01-18 21:44:46
|
Archie Cobbs wrote: > > > However, I don't think this really gives you much advantage. It lets > > > a thread continue in native mode instead of halting, but it probably > > > is not going to get much further before having to come back to java mode > > > and then halt anyway. Just a thought experiment really. > > > > Theoretically, it could quite possibly work (I would have to think carefully > > about all corner cases, but there's no deep reason it wouldn't work), but > > practically, I don't see much benefit. Current code simply depends on > > the well tested _svmf_halt_if_requested(). Adding custom code for such critical > > and difficult to write correctly code (even though it is short, it is very > > tricky) is not something I look forward to. :-) > > I hear you :-) Simplicity is sometimes it's own reward.. Actually I forgot to mention my original thought. I think the following statement is true: If it is not safe to let halting threads enter native mode, then SableVM currently has a bug. The reasoning is simple: pending_halt_thread_count only counts threads that are running in Java mode. When it reaches zero, you consider the world halted, yet there may very well be threads running in native mode that had already entered native mode when stop_the_world() was called (and so they didn't count in the pending_halt_thread_count total). So if that's the case, then my idea of allowing halting threads to enter native mode should not be adding any bugs that aren't already there. Am I making any sense? :-) Thanks, -Archie __________________________________________________________________________ Archie Cobbs * Halloo Communications * http://www.halloo.com |