cpython/Misc
Tim Peters 2e7e7df969 An Anonymous Coward on c.l.py posted a little program with bizarre
behavior, creating many threads very quickly.  A long debugging session
revealed that the Windows implementation of PyThread_start_new_thread()
was choked with "laziness" errors:

1. It checked MS _beginthread() for a failure return, but when that
   happened it returned heap trash as the function result, instead of
   an id of -1 (the proper error-return value).

2. It didn't consider that the Win32 CreateSemaphore() can fail.

3. When creating a great many threads very quickly, it's quite possible
   that any particular bootstrap call can take virtually any amount of
   time to return.  But the code waited for a maximum of 5 seconds, and
   didn't check to see whether the semaphore it was waiting for got
   signaled.  If it in fact timed out, the function could again return
   heap trash as the function result.  This is actually what confused
   the test program, as the heap trash usually turned out to be 0, and
   then multiple threads all got id 0 simultaneously, confusing the
   hell out of threading.py's _active dict (mapping id to thread
   object).  A variety of baffling behaviors followed from that.

WRT #1 and #2, error returns are checked now, and "thread.error: can't
start new thread" gets raised now if a new thread (or new semaphore)
can't be created.  WRT #3, we now wait for the semaphore without a
timeout.

Also removed useless local vrbls, folded long lines, and changed callobj
to a stack auto (it was going thru malloc/free instead, for no discernible
reason).

Bugfix candidate.
2003-07-04 04:40:45 +00:00
..
RPM 2.3b1 patches 2003-02-24 17:55:37 +00:00
ACKS Added Bob Halley for work on socket.timeout 2003-06-29 03:27:45 +00:00
AIX-NOTES The fix to use . was incorporated 2003-06-08 02:25:17 +00:00
BeOS-NOTES
BeOS-setup.py SF patch 568629 by Oren Tirosh: types made callable. 2002-06-14 20:41:17 +00:00
cheatsheet Correct documentation of check interval - it's 100 by default, not 10 any 2003-07-02 21:38:34 +00:00
find_recursionlimit.py
gdbinit
HISTORY migrate news about 2.1 and earlier releases from NEWS to HISTORY in 2002-09-17 20:55:31 +00:00
indent.pro
NEWS An Anonymous Coward on c.l.py posted a little program with bizarre 2003-07-04 04:40:45 +00:00
NEWS.help Updated (2.3 OK now) 2003-01-03 03:29:58 +00:00
Porting
PURIFY.README
pymemcompat.h Fix grammatically inept comment. 2002-08-22 13:36:11 +00:00
python-mode.el Remove short-circuitying grubbing by using last grubbed buffer. It's 2003-06-17 19:18:57 +00:00
python.man Remove -U from argument list. 2003-05-26 05:15:35 +00:00
README Note the existence of SpecialBuilds.txt. 2002-07-11 01:01:49 +00:00
RFD
setuid-prog.c
SpecialBuilds.txt _Py_PrintReferenceAddresses(): also print the type name. In real use 2003-04-18 00:45:59 +00:00
vgrindefs Add 'yield' as a keyword 2001-08-06 17:42:53 +00:00

Python Misc subdirectory
========================

This directory contains files that wouldn't fit in elsewhere.  Some
documents are only of historic importance.

Files found here
----------------

ACKS		Acknowledgements
AIX-NOTES	Notes for building Python on AIX
BeOS-NOTES	Notes for building on BeOS
BeOS-setup.py	setup.py replacement for BeOS, see BeOS-NOTES
cheatsheet	Quick summary of Python by Ken Manheimer
find_recursionlimit.py  Script to find a value for sys.maxrecursionlimit
gdbinit		Handy stuff to put in your .gdbinit file, if you use gdb
HISTORY		News from previous releases -- oldest last
HPUX-NOTES	Notes about dynamic loading under HP-UX
indent.pro	GNU indent profile approximating my C style
NEWS		News for this release (for some meaning of "this")
Porting		Mini-FAQ on porting to new platforms
PURIFY.README	Information for Purify users
python.man	UNIX man page for the python interpreter
python-mode.el	Emacs mode for editing Python programs
README		The file you're reading now
RFD		Request For Discussion about a Python newsgroup
RPM		(Old) tools to build RPMs
SpecialBuilds.txt     Describes extra symbols you can set for debug builds
setuid-prog.c	C helper program for set-uid Python scripts
vgrindefs	Python configuration for vgrind (a generic pretty printer)