This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author zanella
Recipients amaury.forgeotdarc, benjamin.peterson, rhettinger, zanella
Date 2008-02-21.13:06:03
SpamBayes Score 0.0007748743
Marked as misclassified No
Message-id <1203599165.91.0.865166920052.issue2149@psf.upfronthosting.co.za>
In-reply-to
Content
@gutworth: Since one of the main uses of Queue is with threads, I think
it *really* should acquire the mutex before changing the maxsize;

@amaury.forgeotdarc: Your patch makes the point of allowing the size to
be changed at some other place (e.g.: an attribute of an instance passed
as the maxsize), but as stated above I think (am not an expert) the
mutex really should be held before the maxsize change, another point:
using an instance on your patch a call to Queue.maxsize would return
something like:
"""
Python 2.5.1 (r251:54863, Oct  5 2007, 13:36:32)
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> class C:
...   def __init(self): self.n = 1;
...   def __int__(self): return int(self.n);
...
>>> c = C()
>>> import Queue
>>> q = Queue.Queue(c)
>>> q.maxsize
<__main__.C instance at 0xb7c341ac>
>>>                                        
"""
wich would force to have a get() to the maxsize attribute;

I have added a diff;
History
Date User Action Args
2008-02-21 13:06:06zanellasetspambayes_score: 0.000774874 -> 0.0007748743
recipients: + zanella, rhettinger, amaury.forgeotdarc, benjamin.peterson
2008-02-21 13:06:05zanellasetspambayes_score: 0.000774874 -> 0.000774874
messageid: <1203599165.91.0.865166920052.issue2149@psf.upfronthosting.co.za>
2008-02-21 13:06:04zanellalinkissue2149 messages
2008-02-21 13:06:03zanellacreate