• Look free ID genertion (was: Is there a more efficient threading lock?)

    From Dieter Maurer@21:1/5 to Chris Angelico on Wed Mar 1 19:43:06 2023
    Chris Angelico wrote at 2023-3-1 12:58 +1100:
    ...
    The
    atomicity would be more useful in that context as it would give
    lock-free ID generation, which doesn't work in Python.

    I have seen `itertools.count` for that.
    This works because its `__next__` is implemented in "C" and
    therefore will not be interrupted by a thread switch.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)