[Mono-bugs] [Bug 27796][Nor] Changed - patch to speed to mono_class_vtable

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
15 Jul 2002 19:06:00 -0000


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by lupus@ximian.com.

http://bugzilla.ximian.com/show_bug.cgi?id=27796

--- shadow/27796	Mon Jul 15 13:20:33 2002
+++ shadow/27796.tmp.2651	Mon Jul 15 15:06:00 2002
@@ -67,6 +67,24 @@
 
 BTW, I tried caching the string vtable in the domain structure, but
 a lot of calls are made from mono_array_new, which in turn, is called
 by a lot of the icall functions with non-constant class argument, so
 they are harder to optimise. The patch (if working) can speed up
 these calling sites as well.
+
+------- Additional Comments From lupus@ximian.com  2002-07-15 15:05 -------
+Even if you change the assignment order, the lock is still held in the
+domain: another domain could be updating the class at the same time.
+
+Domain1             Domain2
+take lock           take lock
+check cached_domain check cached_domain
+set cached_domain   ...
+...                 set cached_domain
+...                 set cached_vtable
+set cached_vtable   ...
+
+So cached_domain and cached_vtable are mismatched.
+I think using just cached_vtable may reduce (and void) the race:
+we can alwasy access the domain through vtable->domain.
+
+