Author: Tobias Weber <tobias_webe...@gmx.de>
Branch: c8-tcp-style-trx-length
Changeset: r2083:2f066c0fb56c
Date: 2017-07-04 12:38 +0200
http://bitbucket.org/pypy/stmgc/changeset/2f066c0fb56c/

Log:    Improve backoff parameter calculation

diff --git a/c8/stm/nursery.c b/c8/stm/nursery.c
--- a/c8/stm/nursery.c
+++ b/c8/stm/nursery.c
@@ -35,7 +35,8 @@
             new = STM_MIN_RELATIVE_TRANSACTION_LENGTH;
         }
         // the shorter the trx, the more backoff: 1000 at min trx length, 
proportional decrease to 1 at max trx length (think a/x + b = backoff)
-        tl->transaction_length_backoff = (int)(0.0000001 / new - 0.9999999);
+        tl->transaction_length_backoff = (int)(1 / (100000000 * new) + 5);
+        // printf("thread %d, backoff %d\n", tl->thread_local_counter, 
tl->transaction_length_backoff);
         tl->linear_transaction_length_increment = new;
     } else if (tl->transaction_length_backoff == 0) {
         // backoff counter is zero, exponential increase up to 1
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to