Hi,
I'm sorry to disturb you, but I am studying our Japhar implementation
of a JVM. I have several questions about it :
1/ I don't see the namespace separation provide by the classloader in
the class-repository files. Is there no namespace separation?
(Cf. p. 89 of 'Inside the JAVA Virtual Machine' by B. Venners).
2/ In initialize_class_recurse, the lines after CLASS_NOT_INITIALIZED
don't MONITOR_notifyAll to wakeup threads waiting on the
MONITOR_wait. See the diff, is it OK?
And, why not use a simple MONITOR_enter/MONITOR_exit scheme in this
function initialize_class_recurse?
3/ There are no calls to MONITOR in the class-repository. So how can
you handle the concurrency in the find_class_on_classpath function?
(two differents threads resolving the same class at the same time?)
4/ It is very strange to have the quite same functions
(op_stack_allocate, op_stack_deallocate, etc) in op_stack.h
(inlined) and op_stack.c (not inlined). Why ?
Thanks you, and I apologize for my bad English.
Bye,
Jp.
--
INIRIA/IRISA --- Solidor | E-mail : [EMAIL PROTECTED]
Bureau E-318 (niv. rouge) | Phone : +33 299 847 308
Campus de Beaulieu | Fax : +33 299 847 171
35042 Rennes Cedex, France | http://gloups.home.ml.org
===================================================================
RCS file: /cvsroot/hungry/java/japhar/lib/libruntime/objects.c,v
retrieving revision 1.50
diff -u -r1.50 objects.c
--- objects.c 1998/10/16 20:18:23 1.50
+++ objects.c 1998/11/02 15:26:18
@@ -576,6 +576,7 @@
{
cf->initialization_state = CLASS_INIT_IN_PROGRESS;
cf->initializing_thread = THREAD_getCurrent();
+ MONITOR_exit(clazz_monitor);
calculate_static_field_offsets(env, cf);
if ( ! create_static_fields(env, cf) )
@@ -584,12 +585,15 @@
* Let someone else try again later. [pere]
*/
{
+ MONITOR_enter(clazz_monitor);
cf->initialization_state = CLASS_NOT_INITIALIZED;
+ cf->initializing_thread = NULL;
+
+ MONITOR_notifyAll(clazz_monitor);
+
MONITOR_exit(clazz_monitor);
return;
}
-
- MONITOR_exit(clazz_monitor);
/* initialize the superclass */
load_parent_classes(env, cf);