Author: Armin Rigo <[email protected]>
Branch: stm-thread-2
Changeset: r61486:372747b348cd
Date: 2013-02-20 09:22 +0100
http://bitbucket.org/pypy/pypy/changeset/372747b348cd/
Log: Argh, forgot that count_reads can be much bigger than the limit if
the transaction is atomic.
diff --git a/rpython/translator/stm/src_stm/et.c
b/rpython/translator/stm/src_stm/et.c
--- a/rpython/translator/stm/src_stm/et.c
+++ b/rpython/translator/stm/src_stm/et.c
@@ -391,8 +391,12 @@
/* upon abort, set the reads size limit to 94% of how much was read
so far. This should ensure that, assuming the retry does the same
- thing, it will commit just before it reaches the conflicting point. */
+ thing, it will commit just before it reaches the conflicting point.
+ Note that we should never *increase* the read length limit here. */
limit = d->count_reads;
+ if (limit > d->reads_size_limit_nonatomic) { /* can occur if atomic */
+ limit = d->reads_size_limit_nonatomic;
+ }
if (limit > 0) {
limit -= (limit >> 4);
d->reads_size_limit_nonatomic = limit;
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit