[pypy-issue] [issue1329] stm-thread-2: Many small transactions issue
tracker at bugs.pypy.org
Mon Nov 19 13:56:44 CET 2012
New submission from Remi <remi.meier at gmail.com>:
Here is an artificial example which shows the worst-case behaviour of the current
f = float("0") # turn inevitable
for i in range(1000):
In may_turn_inevitable() we have an operation which (currently) causes the
transaction to turn inevitable. This again causes a transaction break as soon as
possible. Hence, we break out of the normal dispatch() loop and call
stm_perform_transaction() (which commits the transaction, starts a new one and
calls us again).
In a normal transaction, we now execute the "return f" which will raise ExitFrame
and cause us to return from the callback, commit and end the current call to
stm_perform_transaction() and therefore start a new inevitable transaction again.
This one will also commit as soon as possible (before we call may_turn_inevitable
In the end we alternate between very short normal and inevitable transactions.
A real world example where this can be observed is in
nosy: Remi, pypy-issue
priority: performance bug
title: stm-thread-2: Many small transactions issue
PyPy bug tracker <tracker at bugs.pypy.org>
More information about the pypy-issue