[Python-Dev] PEP 509: Add a private version to dict (original) (raw)
Greg Ewing greg.ewing at canterbury.ac.nz
Thu Jan 21 00:20:42 EST 2016
- Previous message (by thread): [Python-Dev] PEP 509: Add a private version to dict
- Next message (by thread): [Python-Dev] PEP 509: Add a private version to dict
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Andrew Barnert via Python-Dev wrote:
imagine someone manages to remove the GIL from CPython by using STM: now most transactions are bumping that global counter, meaning most transactions fail and have to be retried,
If this becomes a problem, the tag could be split into two parts of m and n bits, with m + n = 64. Use a global counter for allocating the high half, and increment the low half locally. When the low half overflows, allocate a new high half.
A value of n = 16 or so ought to reduce contention for the global counter to something fairly negligible, I would think, without much risk of the high half ever wrapping around.
-- Greg
- Previous message (by thread): [Python-Dev] PEP 509: Add a private version to dict
- Next message (by thread): [Python-Dev] PEP 509: Add a private version to dict
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]