[Python-ideas] Python 3000 TIOBE -3%
mwm at mired.org
Mon Feb 13 06:57:40 CET 2012
On Sun, 12 Feb 2012 18:36:40 -0800
"C. Titus Brown" <ctb at msu.edu> wrote:
> "All of them except subprocess, on some platforms" is the answer, AFAIK. Which
> is kind of the point.
Do you have any documentation to back this up? For instance, The
collections and random module are both known to have code in them that
isn't thread safe. For the random module, you can check the docstring:
Help on method gauss in module random:
gauss(self, mu, sigma) method of random.Random instance
mu is the mean, and sigma is the standard deviation. This is
slightly faster than the normalvariate() function.
Not thread-safe without a lock around calls.
For the collections module, I quote the functools module:
lock = Lock() # needed because ordereddicts aren't threadsafe
The argparse and pprint modules both use ordereddicts without either
locking them providing an explanation as to why they don't need to,
which makes both of them suspect as well.
Given those cases, I'm not willing to trust a simple assertion that a
module is thread-safe, unless it's from the author or a primary
maintainer of the module, or someone who's actually audited the module
in question for thread safety.
Mike Meyer <mwm at mired.org> http://www.mired.org/
Independent Software developer/SCM consultant, email for more information.
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
More information about the Python-ideas