Author: Armin Rigo <[email protected]>
Branch: c8-hashtable
Changeset: r1715:781a83c7d30f
Date: 2015-03-11 10:24 +0100
http://bitbucket.org/pypy/stmgc/changeset/781a83c7d30f/
Log: We only need one privatization lock at once
diff --git a/c8/stm/gcpage.c b/c8/stm/gcpage.c
--- a/c8/stm/gcpage.c
+++ b/c8/stm/gcpage.c
@@ -146,14 +146,14 @@
memcpy(dest, initial_data, size_rounded_up);
((struct object_s *)dest)->stm_flags = GCFLAG_WRITE_BARRIER;
- acquire_all_privatization_locks();
-
long j;
for (j = 1; j <= NB_SEGMENTS; j++) {
const char *src = initial_data;
char *dest = get_segment_base(j) + nobj;
char *end = dest + size_rounded_up;
+ acquire_privatization_lock(j);
+
while (((uintptr_t)dest) / 4096 != ((uintptr_t)end - 1) / 4096) {
uintptr_t count = 4096 - ((uintptr_t)dest) / 4096;
_fill_preexisting_slice(j, dest, src, count);
@@ -169,10 +169,9 @@
assert(!was_read_remote(get_segment_base(j), (object_t *)nobj));
}
#endif
+ release_privatization_lock(j);
}
- release_all_privatization_locks();
-
write_fence(); /* make sure 'nobj' is fully initialized from
all threads here */
return (object_t *)nobj;
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit