Are min() and max() thread-safe?

Niklas Norrthon niklas.norrthon at hotmail.com
Thu Sep 17 01:41:16 EDT 2009


On 17 Sep, 06:33, Steven D'Aprano
<ste... at 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 fundamentally silly by having them walk over the same list
> simultaneously?
>
For one time sequences like files and generators your code is broken
for obvious reasons.

/Niklas Norrthon



More information about the Python-list mailing list