Re: CPython 2.7: Weakset data changing size during internal iteration
- From: Steven D'Aprano <steve+comp.lang.python@xxxxxxxxxxxxx>
- Date: 02 Jun 2012 03:05:01 GMT
On Fri, 01 Jun 2012 08:23:44 -0700, Temia Eszteri wrote:
I've got a bit of a problem - my project uses weak sets in multiple
areas, the problem case in particular being to indicate what objects are
using a particular texture, if any, so that its priority in OpenGL can
be adjusted to match at the same time as it being (de)referenced by any
explicit calls.
Problem is that for certain high-frequency operations, it seems there's
too much data going in and out for it to handle
I doubt that very much. If you are using threads, it is more likely your
code has a race condition where you are modifying a weak set at the same
time another thread is trying to iterate over it (in this case, to
determine it's length), and because it's a race condition, it only
happens when conditions are *just right*. Since race conditions hitting
are usually rare, you only notice it when there's a lot of data.
--
Steven
.
- References:
- CPython 2.7: Weakset data changing size during internal iteration
- From: Temia Eszteri
- CPython 2.7: Weakset data changing size during internal iteration
- Prev by Date: Use a locally built Tk for Python?
- Next by Date: Re: ctypes callback with char array
- Previous by thread: CPython 2.7: Weakset data changing size during internal iteration
- Next by thread: Use a locally built Tk for Python?
- Index(es):
Relevant Pages
|