I'm having
trouble debugging. Are min() and max() thread-safe, or am I doing
something fundamentally silly by having them walk over the same list
simultaneously?
min() and max() don't release the GIL, so yes, they are safe, and
shouldn't see a list in an inconsistent state (with regard
Steven D'Aprano ste...@remove.this.cybersource.com.au writes:
min() and max() don't release the GIL, so yes, they are safe, and
shouldn't see a list in an inconsistent state (with regard to the
Python interpreter, but not necessarily to your application). But a
threaded approach is somewhat
Steven D'Aprano wrote:
I have two threads, one running min() and the other running max() over
the same list. I'm getting some mysterious results which I'm having
trouble debugging. Are min() and max() thread-safe, or am I doing
something fundamentally silly by having them walk over the same
On Sep 16, 11:33 pm, Steven D'Aprano
ste...@remove.this.cybersource.com.au wrote:
I have two threads, one running min() and the other running max() over
the same list. I'm getting some mysterious results which I'm having
trouble debugging. Are min() and max() thread-safe, or am I doing
On Thursday 17 September 2009 06:33:05 Steven D'Aprano wrote:
I have two threads, one running min() and the other running max() over
the same list. I'm getting some mysterious results which I'm having
trouble debugging. Are min() and max() thread-safe, or am I doing
something fundamentally
. Are min() and max() thread-safe, or am I doing
something fundamentally silly by having them walk over the same list
simultaneously?
My code is as follows. Is there anything obviously wrong with it?
Apart from the plethora of indirection, nothing I can see.
But there is something rotten
On Sep 16, 9:33 pm, Steven D'Aprano
ste...@remove.this.cybersource.com.au wrote:
def minmax(seq):
result = [None, None]
t1 = MMThread(seq, min, result, 0)
t2 = MMThread(seq, max, result, 1)
t1.start()
t2.start()
# Block until all threads are done.
while
On Thursday 17 September 2009 12:57:18 Carl Banks wrote:
On Sep 17, 2:18 am, Hendrik van Rooyen hend...@microcorp.co.za
wrote:
When running min or max on a list of ints, there is probably no
occasion for the function to release the GIL. If a thread doesn't
release the GIL no other Python
On Sep 17, 7:02 am, Carl Banks pavlovevide...@gmail.com wrote:
On Sep 16, 9:33 pm, Steven D'Aprano
ste...@remove.this.cybersource.com.au wrote:
def minmax(seq):
result = [None, None]
t1 = MMThread(seq, min, result, 0)
t2 = MMThread(seq, max, result, 1)
t1.start()
I have two threads, one running min() and the other running max() over
the same list. I'm getting some mysterious results which I'm having
trouble debugging. Are min() and max() thread-safe, or am I doing
something fundamentally silly by having them walk over the same list
simultaneously?
My
On Thu, 17 Sep 2009 04:33:05 +, Steven D'Aprano wrote:
I have two threads, one running min() and the other running max() over
the same list. I'm getting some mysterious results which I'm having
trouble debugging. Are min() and max() thread-safe, or am I doing
something fundamentally silly
On Sep 16, 2009, at 9:33 PM, Steven D'Aprano wrote:
I have two threads, one running min() and the other running max() over
the same list. I'm getting some mysterious results which I'm having
trouble debugging. Are min() and max() thread-safe, or am I doing
something fundamentally silly by having
I dont see anything wrong with it and it works for me on a sequence of 5000
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, 16 Sep 2009 22:08:40 -0700, Miles Kaufmann wrote:
On Sep 16, 2009, at 9:33 PM, Steven D'Aprano wrote:
I have two threads, one running min() and the other running max() over
the same list. I'm getting some mysterious results which I'm having
trouble debugging. Are min() and max
On 17 Sep, 06:33, Steven D'Aprano
ste...@remove.this.cybersource.com.au wrote:
I have two threads, one running min() and the other running max() over
the same list. I'm getting some mysterious results which I'm having
trouble debugging. Are min() and max() thread-safe, or am I doing
something
15 matches
Mail list logo