Author: Remi Meier <[email protected]>
Branch: nogil-unsafe-2
Changeset: r90486:ed5c6b5b1083
Date: 2017-03-02 15:42 +0100
http://bitbucket.org/pypy/pypy/changeset/ed5c6b5b1083/
Log: (arigo, remi) disable pinning for now
diff --git a/rpython/memory/gc/incminimark.py b/rpython/memory/gc/incminimark.py
--- a/rpython/memory/gc/incminimark.py
+++ b/rpython/memory/gc/incminimark.py
@@ -530,6 +530,7 @@
# Estimate this number conservatively
bigobj = self.nonlarge_max + 1
self.max_number_of_pinned_objects = self.nursery_size / (bigobj *
2)
+ self.max_number_of_pinned_objects = 0 # XXX
#
# Round up
ll_assert((self.cache_line_min & (self.cache_line_min - 1)) == 0,
@@ -2322,13 +2323,8 @@
debug_start("gc-collect-step")
debug_print("starting gc state: ", GC_STATES[self.gc_state])
# Debugging checks
- if self.pinned_objects_in_nursery == 0:
- ll_assert(self.get_nursery_free() == llmemory.NULL,
+ ll_assert(self.get_nursery_free() == llmemory.NULL,
"nursery not empty in major_collection_step()")
- else:
- # XXX try to add some similar check to the above one for the case
- # that the nursery still contains some pinned objects (groggi)
- pass
self.debug_check_consistency()
#
diff --git a/rpython/translator/c/test/test_standalone.py
b/rpython/translator/c/test/test_standalone.py
--- a/rpython/translator/c/test/test_standalone.py
+++ b/rpython/translator/c/test/test_standalone.py
@@ -1435,12 +1435,20 @@
def __init__(self, prev):
self.prev = prev
+ class State:
+ pass
+ state = State()
+
def bootstrap():
rthread.gc_thread_start()
x = None
for i in range(1000000):
x = X(x)
- os.write(1, "hi there\n")
+
+ state.lock.acquire(True)
+ os.write(1, "counter=%d\n" % state.counter)
+ state.counter -= 1
+ state.lock.release()
rthread.gc_thread_die()
def new_thread():
@@ -1450,14 +1458,19 @@
def entry_point(argv):
os.write(1, "hello world\n")
# start 5 new threads
- ident1 = new_thread()
- ident2 = new_thread()
- ident3 = new_thread()
- ident4 = new_thread()
- ident5 = new_thread()
- # wait for the 5 threads to finish
- time.sleep(1)
- gc.collect()
+ TS = 30
+ state.lock = rthread.allocate_lock()
+ state.counter = TS
+
+ for _ in range(TS):
+ new_thread()
+
+ while True:
+ time.sleep(0.5)
+ gc.collect()
+ if state.counter == 0:
+ break
+ os.write(1, "all threads done\n")
return 0
def runme(no__thread):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit