summaryrefslogtreecommitdiffstats
path: root/Python/thread_nt.h
Commit message (Collapse)AuthorAgeFilesLines
* Fix problems in x64 build that were discovered by the testsuite:Kristján Valur Jónsson2007-05-031-58/+5
| | | | | | | | | | | | - Reenable modules on x64 that had been disabled aeons ago for Itanium. - Cleared up confusion about compilers for 64 bit windows. There is only Itanium and x64. Added macros MS_WINI64 and MS_WINX64 for those rare cases where it matters, such as the disabling of modules above. - Set target platform (_WIN32_WINNT and WINVER) to 0x0501 (XP) for x64, and 0x0400 (NT 4.0) otherwise, which are the targeted minimum platforms. - Fixed thread_nt.h. The emulated InterlockedCompareExchange function didn´t work on x64, probaby due to the lack of a "volatile" specifier. Anyway, win95 is no longer a target platform. - Itertools module used wrong constant to check for overflow in count() - PyInt_AsSsize_t couldn't deal with attribute error when accessing the __long__ member. - PyLong_FromSsize_t() incorrectly specified that the operand were unsigned. With these changes, the x64 passes the testsuite, for those modules present.
* Merge change 54909 from release25-maint: Fix several minor issues ↵Kristján Valur Jónsson2007-04-251-3/+3
| | | | discovered using code analysis in VisualStudio 2005 Team Edition
* Patch #1454481: Make thread stack size runtime tunable.Andrew MacIntyre2006-06-131-1/+28
| | | | | | | | | | Heavily revised, comprising revisions: 46640 - original trunk revision (backed out in r46655) 46647 - markup fix (backed out in r46655) 46692:46918 merged from branch aimacintyre-sf1454481 branch tested on buildbots (Windows buildbots had problems not related to these changes).
* Patch #1495999: Part two of Windows CE changes.Martin v. Löwis2006-06-101-0/+2
| | | | | | - update header checks, using autoconf - provide dummies for getenv, environ, and GetVersion - adjust MSC_VER check in socketmodule.c
* Revert revisions:Tim Peters2006-06-041-35/+1
| | | | | | | | | | | | | | | | 46640 Patch #1454481: Make thread stack size runtime tunable. 46647 Markup fix The first is causing many buildbots to fail test runs, and there are multiple causes with seemingly no immediate prospects for repairing them. See python-dev discussion. Note that a branch can (and should) be created for resolving these problems, like svn copy svn+ssh://svn.python.org/python/trunk -r46640 svn+ssh://svn.python.org/python/branches/NEW_BRANCH followed by merging rev 46647 to the new branch.
* clean up function declarations to conform to PEP-7 style.Andrew MacIntyre2006-06-041-20/+40
|
* Patch #1454481: Make thread stack size runtime tunable.Andrew MacIntyre2006-06-041-1/+35
|
* Patch #1492356: Port to Windows CE (patch set 1).Martin v. Löwis2006-05-221-2/+2
|
* Merge ssize_t branch.Martin v. Löwis2006-02-151-2/+2
|
* bug [ 1234979 ] Lock.acquire treats only 1 as TrueGeorg Brandl2005-07-081-1/+1
|
* An Anonymous Coward on c.l.py posted a little program with bizarreTim Peters2003-07-041-23/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* SF patch 522961: Leak in Python/thread_nt.h, from Gerald S. Williams.Tim Peters2002-02-281-14/+1
| | | | | | | 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.
* Remove the unused & broken PyThread_*_sema() functions and related constants.Fred Drake2002-01-191-53/+0
| | | | This closes SF patch #504215.
* Fix a bug in the previous checkin. The wrong bootstrap function wasGuido van Rossum2001-10-161-1/+1
| | | | passed to _beginthread().
* Partial patch from SF #452266, by Jason Petrone.Guido van Rossum2001-10-161-3/+45
| | | | | | 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.)
* SF bug [#456252] Python should never stomp on [u]intptr_t.Tim Peters2001-08-291-2/+2
| | | | | | | | | | | 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.
* REMOVED all CWI, CNRI and BeOpen copyright markings.Guido van Rossum2000-09-011-9/+0
| | | | This should match the situation in the 1.6b1 tree.
* -- from Trent Mick: [Patch #101010] replace use of INT_PTRFredrik Lundh2000-08-071-5/+1
| | | | with uintptr_t (fix MSVC 5.0 build)
* Mass ANSIfication of function definitions. Doesn't cover all 'extern'Thomas Wouters2000-07-221-2/+2
| | | | declarations yet, those come later.
* Change copyright notice - 2nd try.Guido van Rossum2000-06-301-6/+0
|
* Change copyright notice.Guido van Rossum2000-06-301-22/+7
|
* Trent Mick <trentm@activestate.com>:Fred Drake2000-06-301-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | The common technique for printing out a pointer has been to cast to a long and use the "%lx" printf modifier. This is incorrect on Win64 where casting to a long truncates the pointer. The "%p" formatter should be used instead. The problem as stated by Tim: > Unfortunately, the C committee refused to define what %p conversion "looks > like" -- they explicitly allowed it to be implementation-defined. Older > versions of Microsoft C even stuck a colon in the middle of the address (in > the days of segment+offset addressing)! The result is that the hex value of a pointer will maybe/maybe not have a 0x prepended to it. Notes on the patch: There are two main classes of changes: - in the various repr() functions that print out pointers - debugging printf's in the various thread_*.h files (these are why the patch is large) Closes SourceForge patch #100505.
* - workaround to make 1.6 build under MSVC 5.0. hopefully,Fredrik Lundh2000-06-291-0/+4
| | | | | trent (who broke it in the first place ;-) will come up with a cleaner solution.
* Trent Mick's Win64 changes: size_t vs. int or long; also some overflowGuido van Rossum2000-06-281-2/+5
| | | | tests.
* Bill Tutt:Guido van Rossum2000-05-111-1/+24
| | | | | Calling Sleep(0) for a spinlock can cause a priority inversion, adding comments to explain what's going on.
* Quick fix by Mark Hammond -- Yakov changed a dprintf call but it wasGuido van Rossum2000-05-051-1/+1
| | | | referencing an undefined variable, so we better change it back.
* Fast NonRecursiveMutex support by Yakov Markovitch, markovitch@iso.ru,Guido van Rossum2000-05-041-25/+113
| | | | | | | | | | | | | | | | | | who wrote: Here's the new version of thread_nt.h. More particular, there is a new version of thread lock that uses kernel object (e.g. semaphore) only in case of contention; in other case it simply uses interlocked functions, which are faster by the order of magnitude. It doesn't make much difference without threads present, but as soon as thread machinery initialised and (mostly) the interpreter global lock is on, difference becomes tremendous. I've included a small script, which initialises threads and launches pystone. With original thread_nt.h, Pystone results with initialised threads are twofold worse then w/o threads. With the new version, only 10% worse. I have used this patch for about 6 months (with threaded and non-threaded applications). It works remarkably well (though I'd desperately prefer Python was free-threaded; I hope, it will soon).
* The rest of the changes by Trent Mick and Dale Nagata for warning-freeGuido van Rossum2000-01-201-1/+1
| | | | compilation on NT Alpha. Mostly added casts etc.
* Thanks to Chris Herborth, the thread primitives now have proper Py*Guido van Rossum1998-12-211-45/+45
| | | | | names in the source code (they already had those for the linker, through some smart macros; but the source still had the old, un-Py names).
* Use _beginthread() and _endthread() in favor of CreateThread() andGuido van Rossum1997-08-141-16/+8
| | | | | | | ExitThread(). As discussed in c.l.p, this takes care of initialization and finalization of thread-local storage allocated by the C runtime system. Not sure whether non-MS compilers grok this though (but who cares :-).
* New permission notice, includes CNRI.Guido van Rossum1996-10-251-13/+20
|
* Sjoerd's thread changes (including down_sema typo fix).Guido van Rossum1996-10-081-1/+5
| | | | Note: waitflag not supported on NT.
* nt thread supportGuido van Rossum1995-01-171-0/+245