Python queue madness
version5 at gmail.com
Thu Apr 3 14:24:11 CEST 2008
Hrm, it sounds likely that I am using something mutable and that is messing
things up. I'll look into it.
As for providing sample code to recreate the problem, I would find it
difficult I think to provide a simple example that accurately reflects what
is truly going on so there wouldn't be much point.
On Thu, Apr 3, 2008 at 5:39 AM, Gabriel Genellina <gagsl-py2 at yahoo.com.ar>
> En Wed, 02 Apr 2008 10:52:08 -0300, nnp <version5 at gmail.com> escribió:
> > Basically I have a system where component 1, 2 and 3 communicate with
> > each
> > other using two Python Queues, we'll call them R and W. Here is what is
> > happening
> > 1 writes data to W and reads from R
> > 2 reads data from W and writes data it receives from 3 to R (but not
> > data it
> > receives from 1)
> > 3 writes to W
> > The problem is that data being written by 1 to W is appearing back on R.
> > I
> > have verified that 1 never writes to R and that 2 never writes data it
> > receives from 1 to R, by overwriting the put() and put_nowait() methods
> > of
> > R.
> > Is there any other way for data to get onto a queue or are there any
> > known
> > bugs with Python's Queue module that could lead to this kind of
> > behaviour?
> Yes, your own code :)
> Perhaps you put mutable objects into the queue, like a list? and later
> modify the list in another place?
> Gabriel Genellina
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list