[issue15329] clarify which deque methods are thread-safe

2015-04-25 Thread xiaobing jiang
Changes by xiaobing jiang s7v7nisla...@gmail.com: -- nosy: +s7v7nisla...@gmail.com ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15329 ___ ___

[issue15329] clarify which deque methods are thread-safe

2013-10-10 Thread Raymond Hettinger
Raymond Hettinger added the comment: So, is deque a faster replacement for Queue.Queue or not? Yes, it is faster. The Queue module itself uses the deque internally. And the Queue is slowed down a bit through locks, function indirection, and additional features such as maxsize, join, and

[issue15329] clarify which deque methods are thread-safe

2013-10-10 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15329 ___

[issue15329] clarify which deque methods are thread-safe

2013-09-22 Thread anatoly techtonik
anatoly techtonik added the comment: So, is deque a faster replacement for Queue.Queue or not? -- nosy: +techtonik ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15329 ___

[issue15329] clarify which deque methods are thread-safe

2012-07-12 Thread Chris Jerdonek
Chris Jerdonek chris.jerdo...@gmail.com added the comment: I think some of the information in the issue 15330 comments would be very helpful to add as well (what thread-safe means in Python, distinction between thread-safe and atomic, and which deque methods are thread-safe and/or atomic). If

[issue15329] clarify which deque methods are thread-safe

2012-07-12 Thread Raymond Hettinger
Raymond Hettinger raymond.hettin...@gmail.com added the comment: I think you're over-reaching. We make almost no guarantees about atomicity. Having multiple implementations of Python makes that an even harder task. In general, critical sections need to be guarded with locks. If an object

[issue15329] clarify which deque methods are thread-safe

2012-07-12 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Pypy tends to make fewer guarantees because it implements more classes in pure python. This is not exactly true; in PyPy the _collection module was rewritten in RPython (which is translated to C) for this very reason: to make

[issue15329] clarify which deque methods are thread-safe

2012-07-12 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Classes written in C are necessarily thread-safe (they rely on the GIL) That's not really true. A single Py_DECREF() can release the GIL by way of executing a Python __del__ method (or a weakref callback, or even the tp_dealloc of a file

[issue15329] clarify which deque methods are thread-safe

2012-07-12 Thread Chris Jerdonek
Chris Jerdonek chris.jerdo...@gmail.com added the comment: I created issue 15339 to document the multi-threading facts of life in Python (independent of any particular module or package, including this one), along the lines suggested by Raymond. --

[issue15329] clarify which deque methods are thread-safe

2012-07-11 Thread Chris Jerdonek
New submission from Chris Jerdonek chris.jerdo...@gmail.com: I think it would help to clarify which collections.deque methods are thread-safe: http://docs.python.org/dev/library/collections.html?highlight=deque#collections.deque Currently, the documentation says that Deques support

[issue15329] clarify which deque methods are thread-safe

2012-07-11 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- assignee: docs@python - rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15329 ___