Changes by Warren DeLano:
--
components: Windows
nosy: delwarl
severity: normal
status: open
title: threading.RLock().aquire(0) fails with python-2.5.1.amd64.msi
type: behavior
versions: Python 2.5
__
Tracker <[EMAIL PROTECTED]>
<http://bugs.p
New submission from Warren DeLano:
import threading
rlock = threading.RLock()
rlock.acquire(0)
# always returns False with python-2.5.1.amd64.msi
# even though
rlock.acquire()
# returns True as expected.
# All attempts to acquire locks without blocking are foiled
Warren DeLano added the comment:
Yes. Here's what I think the problem is: InterlockedCompareExchange
called from EnterNonRecursiveMutex in thread_nt.h:101 seems to returns
(-1) as 0x instead of 0x. Still working
out why t
Warren DeLano added the comment:
Hmm. Well, for one thing, we're falling back on Python's
interlocked_cmp_xchg instead of using Windows'
InterlockedCompareExchange (or should it InterlockCompareExchange64?).
Python's implementation is clearly assuming 64 bit counters, b
Warren DeLano added the comment:
Disabling Python's emulated InterlockedCompareExchange (for Win95
compatibility) cures the problem, so the underlying question is why the
existence of InterlockedCompareExchange is not being autodetected on 64
bit systems -- and that is apparently be
Warren DeLano added the comment:
Patch attached. Do note that this patch will break threading on Win95
in order to achieve 64-bit compatibility. Win98 and up should be
fine -- however, that assertion has not yet been confirmed.
Added file: http://bugs.python.org/file8621/thread_nt_fix.patch
Warren DeLano added the comment:
No need -- turns out the problem was fixed on April 21st a mere three
days after Python 2.5.1 was released. Please close this issue -- my
rookie mistake not working with SVN source from the start! (gee, I
should have known better...) Sorry for wasting your
Warren DeLano added the comment:
I wouldn't know how take the lead, but with customers breathing down
my neck for x64 support, my own threading.Rlock-dependent software
product cannot support x64 until an official Python release supports
it.
So I guess that automatically puts me i