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

2015-06-09 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- resolution: -> not a bug status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing

[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%22&pp=0&ff=1&mp=1&ml=1&me=1&md=1&filterChecked=true -- nosy: +serhiy.storchaka ___ Python tracker

[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 not

[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 #

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

2015-06-08 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list

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

2015-06-08 Thread Yury Selivanov
Changes by Yury Selivanov : -- nosy: +yselivanov ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[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 *befor

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

2015-06-08 Thread Andrew Svetlov
Changes by Andrew Svetlov : -- type: -> enhancement ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma