[issue24411] Drop redundant lock in queue.Queue methods qsize(), empty() and full()

2015-06-09 Thread Andrew Svetlov
Andrew Svetlov added the comment: Raymond, is there known custom third-party queue class derived from queue.Queue? I believe all those are in stdlib only. Also locking guarantee is promised by comment in source code only, documentation says nothing about it. I believe proposed change will

[issue24411] Drop redundant lock in queue.Queue methods qsize(), empty() and full()

2015-06-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, there are. https://code.openhub.net/search?s=%22def%20_qsize%22%20%22import%20Queue%22pp=0ff=1mp=1ml=1me=1md=1filterChecked=true -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org

[issue24411] Drop redundant lock in queue.Queue methods qsize(), empty() and full()

2015-06-09 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- resolution: - not a bug status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24411 ___

[issue24411] Drop redundant lock in queue.Queue methods qsize(), empty() and full()

2015-06-08 Thread Yury Selivanov
Changes by Yury Selivanov yseliva...@gmail.com: -- nosy: +yselivanov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24411 ___ ___ Python-bugs-list

[issue24411] Drop redundant lock in queue.Queue methods qsize(), empty() and full()

2015-06-08 Thread Andrew Svetlov
Changes by Andrew Svetlov andrew.svet...@gmail.com: -- type: - enhancement ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24411 ___ ___

[issue24411] Drop redundant lock in queue.Queue methods qsize(), empty() and full()

2015-06-08 Thread Andrew Svetlov
New submission from Andrew Svetlov: Now those methods use lock for querying queue size, like def qsize(self): with self.mutex: return self._qsize() The lock is not necessary because thread context switch may be done *after* returning from mutex protected code but

[issue24411] Drop redundant lock in queue.Queue methods qsize(), empty() and full()

2015-06-08 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- assignee: - rhettinger nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24411 ___

[issue24411] Drop redundant lock in queue.Queue methods qsize(), empty() and full()

2015-06-08 Thread Raymond Hettinger
Raymond Hettinger added the comment: It may seem pointless to hold the lock, but it is guaranteed behavior (and has been so for a very, very long time). ''' # Override these methods to implement other queue organizations #