<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/cpython-git.git/Python/thread_nt.h, branch v2.3.6c1</title>
<subtitle>github.com: python/cpython.git
</subtitle>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/'/>
<entry>
<title>An Anonymous Coward on c.l.py posted a little program with bizarre</title>
<updated>2003-07-04T04:40:45+00:00</updated>
<author>
<name>Tim Peters</name>
<email>tim.peters@gmail.com</email>
</author>
<published>2003-07-04T04:40:45+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=2e7e7df96982265022cc0888db954ef4e5301a5c'/>
<id>2e7e7df96982265022cc0888db954ef4e5301a5c</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>SF patch  522961: Leak in Python/thread_nt.h, from Gerald S. Williams.</title>
<updated>2002-02-28T21:34:34+00:00</updated>
<author>
<name>Tim Peters</name>
<email>tim.peters@gmail.com</email>
</author>
<published>2002-02-28T21:34:34+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=e64ef931d6e4ee800fcd156b28269569d989783c'/>
<id>e64ef931d6e4ee800fcd156b28269569d989783c</id>
<content type='text'>
A file-static "threads" dict mapped thread IDs to Windows handles, but
was never referenced, and entries never got removed.  This gets rid of
the YAGNI-dict entirely.
Bugfix candidate.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A file-static "threads" dict mapped thread IDs to Windows handles, but
was never referenced, and entries never got removed.  This gets rid of
the YAGNI-dict entirely.
Bugfix candidate.
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove the unused &amp; broken PyThread_*_sema() functions and related constants.</title>
<updated>2002-01-19T22:02:55+00:00</updated>
<author>
<name>Fred Drake</name>
<email>fdrake@acm.org</email>
</author>
<published>2002-01-19T22:02:55+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=7bb1c9a11db2ecdf58fed5a5e3a7cdea619d52db'/>
<id>7bb1c9a11db2ecdf58fed5a5e3a7cdea619d52db</id>
<content type='text'>
This closes SF patch #504215.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This closes SF patch #504215.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix a bug in the previous checkin.  The wrong bootstrap function was</title>
<updated>2001-10-16T21:50:04+00:00</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>2001-10-16T21:50:04+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=2c40adb1e4d09caef9a459864598c0b2518e7c86'/>
<id>2c40adb1e4d09caef9a459864598c0b2518e7c86</id>
<content type='text'>
passed to _beginthread().
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
passed to _beginthread().
</pre>
</div>
</content>
</entry>
<entry>
<title>Partial patch from SF #452266, by Jason Petrone.</title>
<updated>2001-10-16T21:13:49+00:00</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>2001-10-16T21:13:49+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=3c28863e081986a232d4d2bba3cd9b63e14263c0'/>
<id>3c28863e081986a232d4d2bba3cd9b63e14263c0</id>
<content type='text'>
This changes Pythread_start_thread() to return the thread ID, or -1
for an error.  (It's technically an incompatible API change, but I
doubt anyone calls it.)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This changes Pythread_start_thread() to return the thread ID, or -1
for an error.  (It's technically an incompatible API change, but I
doubt anyone calls it.)
</pre>
</div>
</content>
</entry>
<entry>
<title>SF bug [#456252] Python should never stomp on [u]intptr_t.</title>
<updated>2001-08-29T21:37:10+00:00</updated>
<author>
<name>Tim Peters</name>
<email>tim.peters@gmail.com</email>
</author>
<published>2001-08-29T21:37:10+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=79248aa1e4a8f6510b1f0ef95dc9592d51e16d6c'/>
<id>79248aa1e4a8f6510b1f0ef95dc9592d51e16d6c</id>
<content type='text'>
pyport.h:  typedef a new Py_intptr_t type.
    DELICATE ASSUMPTION:  That HAVE_UINTPTR_T implies intptr_t is
    available as well as uintptr_t.  If that turns out not to be
    true, things must get uglier (C99 wants both, so I think it's
    an assumption we're *likely* to get away with).
thread_nt.h, PyThread_start_new_thread:  MS _beginthread is documented
    as returning unsigned long; no idea why uintptr_t was being used.
Others:  Always use Py_[u]intptr_t, never [u]intptr_t directly.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
pyport.h:  typedef a new Py_intptr_t type.
    DELICATE ASSUMPTION:  That HAVE_UINTPTR_T implies intptr_t is
    available as well as uintptr_t.  If that turns out not to be
    true, things must get uglier (C99 wants both, so I think it's
    an assumption we're *likely* to get away with).
thread_nt.h, PyThread_start_new_thread:  MS _beginthread is documented
    as returning unsigned long; no idea why uintptr_t was being used.
Others:  Always use Py_[u]intptr_t, never [u]intptr_t directly.
</pre>
</div>
</content>
</entry>
<entry>
<title>REMOVED all CWI, CNRI and BeOpen copyright markings.</title>
<updated>2000-09-01T23:29:29+00:00</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>2000-09-01T23:29:29+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=8586991099e4ace18ee94163a96b8ea1bed77ebe'/>
<id>8586991099e4ace18ee94163a96b8ea1bed77ebe</id>
<content type='text'>
This should match the situation in the 1.6b1 tree.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This should match the situation in the 1.6b1 tree.
</pre>
</div>
</content>
</entry>
<entry>
<title>-- from Trent Mick: [Patch #101010] replace use of INT_PTR</title>
<updated>2000-08-07T20:16:28+00:00</updated>
<author>
<name>Fredrik Lundh</name>
<email>fredrik@pythonware.com</email>
</author>
<published>2000-08-07T20:16:28+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=6947d0b65eb21606de8e17b180bf116421d23116'/>
<id>6947d0b65eb21606de8e17b180bf116421d23116</id>
<content type='text'>
   with uintptr_t (fix MSVC 5.0 build)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
   with uintptr_t (fix MSVC 5.0 build)
</pre>
</div>
</content>
</entry>
<entry>
<title>Mass ANSIfication of function definitions. Doesn't cover all 'extern'</title>
<updated>2000-07-22T18:47:25+00:00</updated>
<author>
<name>Thomas Wouters</name>
<email>thomas@python.org</email>
</author>
<published>2000-07-22T18:47:25+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=f70ef4f8606f99744252a804229d53a4d97601c1'/>
<id>f70ef4f8606f99744252a804229d53a4d97601c1</id>
<content type='text'>
declarations yet, those come later.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
declarations yet, those come later.
</pre>
</div>
</content>
</entry>
<entry>
<title>Change copyright notice - 2nd try.</title>
<updated>2000-06-30T23:58:06+00:00</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>2000-06-30T23:58:06+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=ffcc3813d82e6b96db79f518f4e67b940a13ce64'/>
<id>ffcc3813d82e6b96db79f518f4e67b940a13ce64</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
