Author: Tobias Weber <tobias_webe...@gmx.de> Branch: c8-tcp-style-trx-length Changeset: r2079:50a4a53200e3 Date: 2017-06-27 15:01 +0200 http://bitbucket.org/pypy/stmgc/changeset/50a4a53200e3/
Log: Improve backoff duration computation diff --git a/c8/stm/nursery.c b/c8/stm/nursery.c --- a/c8/stm/nursery.c +++ b/c8/stm/nursery.c @@ -34,8 +34,8 @@ } else { new = STM_MIN_RELATIVE_TRANSACTION_LENGTH; } - // the shorter the trx, the more backoff - tl->transaction_length_backoff = (int)(1 / new); + // 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->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