cpython/Lib
Jeffrey Yasskin 69e1309fd4 Thread.start() used sleep(0.000001) to make sure it didn't return before the
new thread had started. At least on my MacBook Pro, that wound up sleeping for
a full 10ms (probably 1 jiffy). By using an Event instead, we can be absolutely
certain that the thread has started, and return more quickly (217us).

Before:
$  ./python.exe -m timeit -s 'from threading import Thread'  't = Thread(); t.start(); t.join()'
100 loops, best of 3: 10.3 msec per loop
$  ./python.exe -m timeit -s 'from threading import Thread; t = Thread()'  't.isAlive()'
1000000 loops, best of 3: 0.47 usec per loop

After:
$  ./python.exe -m timeit -s 'from threading import Thread'  't = Thread(); t.start(); t.join()'
1000 loops, best of 3: 217 usec per loop
$  ./python.exe -m timeit -s 'from threading import Thread; t = Thread()'  't.isAlive()'
1000000 loops, best of 3: 0.86 usec per loop

To be fair, the 10ms isn't CPU time, and other threads including the spawned
one get to run during it. There are also some slightly more complicated ways to
get back the .4us in isAlive() if we want.
2008-02-28 06:09:19 +00:00
..
bsddb Create a db_home directory with a unique name so multiple users can 2008-02-24 18:47:03 +00:00
compiler Issue 2117. Update compiler module to handle class decorators. 2008-02-25 18:06:00 +00:00
ctypes Patch #2167 from calvin: Remove unused imports 2008-02-23 17:40:11 +00:00
curses Use file descriptor for real stdout 2008-02-25 16:29:58 +00:00
distutils Patch #2167 from calvin: Remove unused imports 2008-02-23 17:40:11 +00:00
email Patch #2167 from calvin: Remove unused imports 2008-02-23 17:40:11 +00:00
encodings Fixed bug #1915: Python compiles with --enable-unicode=no again. However several extension methods and modules do not work without unicode support. 2008-01-23 14:20:50 +00:00
hotshot Patch #2167 from calvin: Remove unused imports 2008-02-23 17:40:11 +00:00
idlelib Patch #2167 from calvin: Remove unused imports 2008-02-23 17:40:11 +00:00
lib-tk Patch #2167 from calvin: Remove unused imports 2008-02-23 17:40:11 +00:00
logging Patch #2167 from calvin: Remove unused imports 2008-02-23 17:40:11 +00:00
msilib Properly generate logical file ids. Fixes #1515998. 2006-07-06 19:28:03 +00:00
plat-aix3
plat-aix4
plat-atheos
plat-beos5
plat-darwin
plat-freebsd4
plat-freebsd5
plat-freebsd6 - Add support for FreeBSD 8 which is recently forked from FreeBSD 7. 2007-10-28 11:19:02 +00:00
plat-freebsd7 - Add support for FreeBSD 8 which is recently forked from FreeBSD 7. 2007-10-28 11:19:02 +00:00
plat-freebsd8 - Add support for FreeBSD 8 which is recently forked from FreeBSD 7. 2007-10-28 11:19:02 +00:00
plat-generic
plat-irix5
plat-irix6
plat-linux2
plat-mac Patch #2167 from calvin: Remove unused imports 2008-02-23 17:40:11 +00:00
plat-netbsd1
plat-next3
plat-os2emx
plat-riscos Patch #2167 from calvin: Remove unused imports 2008-02-23 17:40:11 +00:00
plat-sunos5 with and as are now keywords. There are some generated files I can't recreate. 2006-09-06 06:28:06 +00:00
plat-unixware7
site-packages
sqlite3 Patch #2167 from calvin: Remove unused imports 2008-02-23 17:40:11 +00:00
test Speed test_socketserver up from 28.739s to 0.226s, simplify the logic, and make 2008-02-28 05:53:18 +00:00
wsgiref Sync w/external release 0.1.2. Please see PEP 360 before making changes to external packages. 2006-06-12 04:04:32 +00:00
xml #1433694: minidom's .normalize() failed to set .nextSibling for last element. 2008-02-23 17:10:46 +00:00
BaseHTTPServer.py #1492: allow overriding BaseHTTPServer's content type for error messages. 2008-02-23 15:02:28 +00:00
Bastion.py Patch #1698951: clarify deprecation message in rexec and Bastion 2007-04-12 07:01:19 +00:00
CGIHTTPServer.py Patch #1481079: Support of HTTP_REFERER in CGIHTTPServer.py 2007-03-09 03:15:56 +00:00
ConfigParser.py Issue 1781. Now ConfigParser.add_section does not let you add a 2008-02-23 12:46:10 +00:00
Cookie.py Whitespace normalization. 2006-08-15 00:25:04 +00:00
DocXMLRPCServer.py Update PEP URL. 2008-02-05 16:06:57 +00:00
HTMLParser.py Patch #912410: Replace HTML entity references for attribute values 2007-03-06 14:43:00 +00:00
MimeWriter.py Have MimeWriter raise a DeprecationWarning as per PEP 4 and its documentation. 2007-05-30 20:46:26 +00:00
Queue.py Add queues will alternative fetch orders (priority based and stack based). 2008-01-16 23:40:45 +00:00
SimpleHTTPServer.py Patch #2167 from calvin: Remove unused imports 2008-02-23 17:40:11 +00:00
SimpleXMLRPCServer.py Added a flag (_send_traceback_header) to the SimpleXMLRPCServer class 2007-08-17 19:16:44 +00:00
SocketServer.py Add diagnostic message to help figure-out why SocketServer tests occasionally crash 2008-02-14 09:32:45 +00:00
StringIO.py [Bug #1622533] Make docstrings raw strings because they contain control characters (\0, \1) 2007-01-05 14:22:17 +00:00
UserDict.py Update more instances of has_key(). 2008-02-21 19:24:53 +00:00
UserList.py No need to register classes that already inherit from ABCs. 2008-02-11 18:51:08 +00:00
UserString.py No need to register subclass of ABCs. 2008-02-14 19:30:30 +00:00
_LWPCookieJar.py Remove unused import. 2006-05-18 06:18:06 +00:00
_MozillaCookieJar.py Make use of new str.startswith/endswith semantics. 2006-06-09 20:43:48 +00:00
__future__.py I could have sworn this was part of the change to not abbreviate ABSOLUTE 2006-04-03 06:58:51 +00:00
__phello__.foo.py
_abcoll.py Metaclass declaration is inherited 2008-02-09 10:04:19 +00:00
_strptime.py Make _strptime.TimeRE().pattern() use ``\s+`` for matching whitespace instead 2007-06-03 23:13:41 +00:00
_threading_local.py Finally figured out why this module did its imports at the 2006-04-18 03:28:32 +00:00
abc.py Move abc._Abstract into object by adding a new flag Py_TPFLAGS_IS_ABSTRACT, 2008-02-28 04:45:36 +00:00
aifc.py Add a length check to aifc to ensure it doesn't write a bogus file 2006-05-30 00:26:01 +00:00
anydbm.py
asynchat.py [Patch #1002763] Allow long ints as terminator values; also, treat a terminator of 0 like the empty string or None 2005-06-09 14:59:45 +00:00
asyncore.py No need to import exceptions, they are builtins 2005-09-01 00:45:28 +00:00
atexit.py Bug #1597824: return the registered function from atexit.register() 2006-11-16 16:50:59 +00:00
audiodev.py
base64.py Clarify docstring 2006-10-27 17:06:16 +00:00
bdb.py Patch #721464: pdb.Pdb instances can now be given explicit stdin and 2006-05-10 17:13:20 +00:00
binhex.py Remove the macfs module. This led to the deprecation of macostools.touched(); 2007-05-20 23:17:38 +00:00
bisect.py SF 1602378 Clarify docstrings for bisect 2007-04-03 00:02:11 +00:00
cProfile.py Added the cProfile module. 2006-02-08 12:53:56 +00:00
calendar.py Fix typo in docstring for Calendar.itermonthdays(). 2008-02-07 19:57:32 +00:00
cgi.py Patch #1541463: optimize performance of cgi.FieldStorage operations. 2007-09-20 16:06:07 +00:00
cgitb.py HTML-escape the plain traceback in cgitb's HTML output, to prevent 2007-05-15 20:19:34 +00:00
chunk.py Patch #1373643: The chunk module can now read chunks larger than 2006-02-18 21:10:56 +00:00
cmd.py
code.py
codecs.py Fix codecs.EncodedFile which did not use file_encoding in 2.5.0, and 2006-10-29 08:39:22 +00:00
codeop.py Conversion of exceptions over from faked-up classes to new-style C types. 2006-05-27 12:29:24 +00:00
collections.py Neaten-up the named tuple docs 2008-01-10 23:00:01 +00:00
colorsys.py A very minor bug fix: this code looks like it is designed to accept 2006-10-06 16:33:22 +00:00
commands.py Deprecate commands.getstatus(). 2007-03-13 21:32:01 +00:00
compileall.py Bugs item #1069409 C:\Python24\Lib\compileall.py returns False 2004-12-20 00:29:29 +00:00
contextlib.py Fix for bug 1705170 - contextmanager swallowing StopIteration (2.5 backport candidate) 2007-11-02 10:09:12 +00:00
cookielib.py Whitespace normalization. 2007-01-30 03:03:46 +00:00
copy.py Whitespace normalization. 2006-02-26 04:21:50 +00:00
copy_reg.py Removed uses of dict.has_key() from distutils, and uses of 2008-02-21 18:18:37 +00:00
csv.py Patch #1635454: the csv.DictWriter class now includes the offending 2007-03-13 09:32:11 +00:00
dbhash.py
decimal.py Remove duplicate 'import re' in decimal.py 2008-02-24 18:12:36 +00:00
difflib.py Improve usability of the SequenceMatcher by returning named tuples describing match ranges. 2008-01-11 03:20:54 +00:00
dircache.py
dis.py
doctest.py Doctest results return a named tuple for readability 2008-01-11 01:25:54 +00:00
dumbdbm.py Whitespace normalization. 2007-01-30 03:03:46 +00:00
dummy_thread.py Remove specific mention of my name and email address from modules. Not really 2007-01-25 23:30:39 +00:00
dummy_threading.py Remove specific mention of my name and email address from modules. Not really 2007-01-25 23:30:39 +00:00
filecmp.py Removed deprecated use_statcache argument. 2004-12-05 01:58:09 +00:00
fileinput.py Whitespace normalization. 2006-02-19 21:26:07 +00:00
fnmatch.py
formatter.py #1726198: replace while 1: fp.readline() with file iteration. 2008-01-21 17:22:06 +00:00
fpformat.py
fractions.py Change simple instances (in Fraction) of self.numerator and self.denominator to 2008-02-14 07:49:25 +00:00
ftplib.py docstring and comment updates suggested by Giampaolo Rodola' 2008-01-22 23:15:34 +00:00
functools.py Patch # 1739906 by Christian Heimes -- add reduce to functools (importing 2007-08-27 20:51:00 +00:00
genericpath.py Small speedup. 2007-05-14 20:52:31 +00:00
getopt.py
getpass.py Bug #1445068: getpass.getpass() can now be given an explicit stream 2006-03-31 18:42:16 +00:00
gettext.py Patch #1349274: gettext.install() now optionally installs additional 2006-02-19 13:26:36 +00:00
glob.py Fix for glob.py if filesystem encoding is None. 2007-03-20 23:05:14 +00:00
gzip.py Strip the '.gz' extension from the filename that is written to the 2007-02-13 16:24:00 +00:00
hashlib.py email address update 2007-09-09 20:25:00 +00:00
heapq.py Docstring nit. 2007-02-28 18:27:41 +00:00
hmac.py Fixes Issue 1385: The hmac module now computes the correct hmac when using 2007-11-06 00:19:03 +00:00
htmlentitydefs.py
htmllib.py clean up the API a little; exceptions are defined by this module 2004-09-09 02:24:13 +00:00
httplib.py #1627: httplib now ignores negative Content-Length headers. 2008-02-24 00:14:24 +00:00
ihooks.py
imaplib.py #1389051: IMAP module tries to read entire message in one chunk. Patch by Fredrik Lundh. 2008-02-23 19:02:33 +00:00
imghdr.py SF #75103: imghdr -- identify JPEGs in EXIF format 2005-01-07 08:15:41 +00:00
imputil.py Patch #685268: Consider a package's __path__ in imputil. 2007-02-13 08:34:45 +00:00
inspect.py Issue #1916. Added isgenerator() and isgeneratorfunction() to 2008-02-18 03:43:43 +00:00
keyword.py #1726198: replace while 1: fp.readline() with file iteration. 2008-01-21 17:22:06 +00:00
linecache.py Linecache contains support for PEP302 loaders, but fails to deal with loaders 2006-06-13 11:19:56 +00:00
locale.py Patch #1710352: add missing public functions to locale.__all__. 2007-05-01 06:08:15 +00:00
macpath.py Bug #1115886: os.path.splitext('.cshrc') gives now ('.cshrc', ''). 2007-03-07 11:04:33 +00:00
macurl2path.py Bug #649974: make docstrings for url2pathname consistent 2005-12-26 22:53:56 +00:00
mailbox.py Bug 1277: make Maildir use the user-provided factory instead of hard-wiring MaildirMessage. 2008-01-19 20:12:04 +00:00
mailcap.py
markupbase.py Normalized a few cases of whitespace in function declarations. 2006-06-06 12:46:55 +00:00
md5.py email address update 2007-09-09 20:25:00 +00:00
mhlib.py Replace list of constants with tuples of constants. 2005-02-06 06:57:08 +00:00
mimetools.py Bug #1250170, Patch #1462230: handle socket.gethostname() 2006-03-31 17:18:06 +00:00
mimetypes.py Patch 1353 by Jacob Winther. 2007-10-29 20:52:45 +00:00
mimify.py Have mimify raise a DeprecationWarning. The docs and PEP 4 have listed the 2007-05-30 21:48:58 +00:00
modulefinder.py Replaced import of the 'new' module with 'types' module and added a deprecation warning to the 'new' module. 2007-11-27 21:34:01 +00:00
multifile.py
mutex.py
netrc.py
new.py Expose Py_Py3kWarningFlag as sys.py3kwarning as discussed in #1504 2007-11-27 23:16:44 +00:00
nntplib.py - Bug #1015140: disambiguated the term "article id" in nntplib docs and 2005-07-17 20:27:41 +00:00
ntpath.py Patch #2167 from calvin: Remove unused imports 2008-02-23 17:40:11 +00:00
nturl2path.py Bug #649974: make docstrings for url2pathname consistent 2005-12-26 22:53:56 +00:00
numbers.py Update notes on Decimal. 2008-02-14 01:08:02 +00:00
opcode.py Give meaning to the oparg for BUILD_MAP: estimated size of the dictionary. 2007-12-18 21:24:09 +00:00
optparse.py Change isbasestring function as discussed on the cvs list a while ago 2008-01-27 19:01:45 +00:00
os.py Moved the errno import from inside the functions to the 2007-11-27 18:50:12 +00:00
os2emxpath.py - Move functions common to all path modules into genericpath.py and have the 2006-08-26 18:42:06 +00:00
pdb.doc Patch #1393667: pdb now has a "run" command which restarts the debugged 2007-03-13 21:08:15 +00:00
pdb.py test_doctest fails since r59984. 2008-01-15 21:25:11 +00:00
pickle.py Revert previous checkin. 2005-02-07 15:28:45 +00:00
pickletools.py Complete an open todo on pickletools -- add a pickle optimizer. 2008-02-10 20:35:16 +00:00
pipes.py Patch #1680959: add test suite for pipes module. 2007-08-30 10:38:56 +00:00
pkgutil.py Bug #1529871: The speed enhancement patch #921466 broke Python's compliance 2006-07-28 21:12:07 +00:00
platform.py issue1082: Fixing platform and system for Vista. 2007-09-17 20:53:21 +00:00
plistlib.py Follow PEP 8 in module docstring. 2008-01-21 20:18:04 +00:00
popen2.py Use os.closerange() in popen2. 2008-02-23 22:09:24 +00:00
poplib.py More work on SSL support. 2007-09-10 21:51:02 +00:00
posixfile.py Enable platform-specific tweaks for FreeBSD 8 (exactly same to FreeBSD 7's yet) 2007-10-28 12:38:09 +00:00
posixpath.py #1742: don't raise exception on os.path.relpath("a", "a"), but return os.curdir. 2008-01-06 14:27:15 +00:00
pprint.py Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures. 2008-01-24 21:47:56 +00:00
profile.py test and fix for buggy handling of exceptions raised by C functions, 2005-09-20 18:50:13 +00:00
pstats.py #1269: fix a bug in pstats.add_callers() and add a unit test file for pstats. 2008-01-21 10:24:59 +00:00
pty.py Whitespace normalization. 2007-01-30 03:03:46 +00:00
py_compile.py Patch #1171150: add a newline to py_compile error output 2005-06-10 17:15:18 +00:00
pyclbr.py Bug #1560617: in pyclbr, return full module name not only for classes, 2006-09-30 11:06:47 +00:00
pydoc.py #2133: fix HTML color spec. 2008-02-17 21:18:55 +00:00
quopri.py
random.py Issue #1727780: Support loading pickles of random.Random objects created 2007-12-03 19:20:02 +00:00
re.py In the experimental 'Scanner' feature, the group count was set wrong. 2008-02-05 17:32:15 +00:00
repr.py Bug #1153: repr.repr() now doesn't require set and dictionary items 2007-09-12 19:00:07 +00:00
rexec.py Patch #1698951: clarify deprecation message in rexec and Bastion 2007-04-12 07:01:19 +00:00
rfc822.py Bug #1249573: fix rfc822.parsedate not accepting a certain date format 2007-01-22 21:10:33 +00:00
rlcompleter.py Patch #1472854: make the rlcompleter.Completer class usable on non- 2006-04-30 18:14:54 +00:00
robotparser.py fixes 813986 2007-08-28 23:22:52 +00:00
runpy.py Try to make command line error messages from runpy easier to understand (and suppress traceback cruft from the implicitly invoked runpy machinery) 2008-02-22 10:54:06 +00:00
sched.py Issue #1861: Add read-only attribute listing upcoming events in the order they will be run. 2008-01-17 19:31:38 +00:00
sets.py Deprecate the sets module. 2007-01-13 00:29:49 +00:00
sgmllib.py Replace unnecessary function call. 2007-08-06 07:39:09 +00:00
sha.py email address update 2007-09-09 20:25:00 +00:00
shelve.py Revert part of r60927 which made invalid assumptions about the API offered by db modules. 2008-02-25 23:17:41 +00:00
shlex.py Fix parameter passing. 2007-05-24 17:33:33 +00:00
shutil.py #1669: don't allow shutil.rmtree() to be called on a symlink. 2008-01-20 14:17:42 +00:00
site.py Add the correct build dir when building with pydebug. 2008-01-21 21:19:07 +00:00
smtpd.py Issue 1307 by Derek Shockey, fox the same bug for RCPT. 2007-10-23 19:25:41 +00:00
smtplib.py Issue 1776581. Minor corrections to smtplib, and two small tests. 2008-02-23 12:27:17 +00:00
sndhdr.py
socket.py #1389051, #1092502: fix excessively large allocations when using read() on a socket 2008-02-23 19:28:58 +00:00
sre.py Bug #1675967: re patterns pickled with older Python versions can 2007-03-21 20:07:56 +00:00
sre_compile.py Issue #1700, reported by Nguyen Quan Son, fix by Fredruk Lundh: 2008-01-03 19:12:44 +00:00
sre_constants.py
sre_parse.py Make sre's SubPattern objects accept slice objects like it already accepts 2006-12-19 08:17:50 +00:00
ssl.py Patch #2167 from calvin: Remove unused imports 2008-02-23 17:40:11 +00:00
stat.py Patch #1490190: posixmodule now includes os.chflags() and os.lchflags() 2007-02-19 10:55:19 +00:00
statvfs.py
string.py Backport of PEP 3101, Advanced String Formatting, from py3k. 2008-02-17 19:46:49 +00:00
stringold.py Remove outdated references to the regsub module. 2004-12-07 07:55:07 +00:00
stringprep.py Avoid forward-declaring the methods array. 2006-03-10 11:20:04 +00:00
struct.py Added _struct._clearcache() for regression tests 2008-01-04 02:54:42 +00:00
subprocess.py Fix issue 1300: Quote command line arguments that contain a '|' character in 2008-01-19 22:49:37 +00:00
sunau.py
sunaudio.py
symbol.py Patch #1759: Backport of PEP 3129 class decorators 2008-02-23 15:01:05 +00:00
symtable.py Get symtable to limp along, can run compiler/symbols.py. Not saying much, needs more work. 2005-11-25 03:14:00 +00:00
tabnanny.py Make tabnanny recognize IndentationErrors raised by tokenize. 2006-08-14 21:34:08 +00:00
tarfile.py Issue #2004: Use mode 0700 for temporary directories and default 2008-02-05 11:51:40 +00:00
telnetlib.py Added timout parameter to telnetlib.Telnet. Also created 2007-03-29 18:22:35 +00:00
tempfile.py Issue 2021: Allow NamedTemporaryFile and SpooledTemporaryFile to be used as context managers. (The NamedTemporaryFile fix should be considered for backporting to 2.5) 2008-02-09 15:28:09 +00:00
textwrap.py Fix #1146: TextWrap vs words 1-character shorter than the width. 2008-01-19 19:48:19 +00:00
this.py
threading.py Thread.start() used sleep(0.000001) to make sure it didn't return before the 2008-02-28 06:09:19 +00:00
timeit.py Whitespace normalization. Ugh, we really need to do this more often. 2007-04-25 06:30:05 +00:00
toaiff.py
token.py Issue 2117. Update compiler module to handle class decorators. 2008-02-25 18:06:00 +00:00
tokenize.py Fix #1679: "0x" was taken as a valid integer literal. 2008-01-19 19:27:05 +00:00
trace.py Add a timing flag to Trace so you can see where slowness occurs 2008-02-26 08:21:28 +00:00
traceback.py Fix a bug in traceback.format_exception_only() that led to an error 2006-09-24 12:50:24 +00:00
tty.py
types.py Patch #1520294: Support for getset and member descriptors in types.py, 2006-07-27 23:43:15 +00:00
unittest.py Backport PEP 3141 from the py3k branch to the trunk. This includes r50877 (just 2008-01-03 02:21:52 +00:00
urllib.py #1664522: in urllib, don't read non-existing directories in ftp mode, 2008-01-20 12:18:17 +00:00
urllib2.py Fixes Issue 1401. When redirected, a possible POST get converted 2008-02-07 19:06:52 +00:00
urlparse.py #1726198: replace while 1: fp.readline() with file iteration. 2008-01-21 17:22:06 +00:00
user.py
uu.py Jython compatibility fix: if uu.decode() opened its output file, be sure to 2006-11-20 13:39:37 +00:00
uuid.py uuid creation is now threadsafe, backport from py3k rev. 57375. 2007-08-24 06:10:01 +00:00
warnings.py Expose Py_Py3kWarningFlag as sys.py3kwarning as discussed in #1504 2007-11-27 23:16:44 +00:00
wave.py Patch #1681153: the wave module now closes a file object it opened if 2007-03-15 07:41:30 +00:00
weakref.py SF #1479988: add methods to allow access to weakrefs for the 2006-05-02 06:53:59 +00:00
webbrowser.py Fix a few webbrowser.py problems. 2007-07-01 08:11:35 +00:00
whichdb.py Replace list of constants with tuples of constants. 2005-02-06 06:57:08 +00:00
wsgiref.egg-info Sync w/external release 0.1.2. Please see PEP 360 before making changes to external packages. 2006-06-12 04:04:32 +00:00
xdrlib.py Move xdrlib tests from the module into a separate test script, 2006-12-01 16:59:47 +00:00
xmllib.py
xmlrpclib.py #1330538: Improve comparison of xmlrpclib.DateTime and datetime instances. 2008-02-23 16:23:05 +00:00
zipfile.py Document that zipfile decryption is insanely slow and fix a typo and 2008-01-20 01:32:00 +00:00