This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author kristjan.jonsson
Recipients brian.curtin, kristjan.jonsson, loewis, pitrou, python-dev, sbt, tim.golden
Date 2012-04-30.10:03:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <EFE3877620384242A686D52278B7CCD33C797C@RKV-IT-EXCH104.ccp.ad.local>
In-reply-to <1335776708.84.0.784761367867.issue11618@psf.upfronthosting.co.za>
Content
Martin, I think you misunderstand completely. the patch is _not_ about using the VISTA features.  It is about not using a "mutex" for threading.lock.

Currently, the locks in python use Mutex objects, and a WaitForSingleObjects() system call to acquire them.
This patch replaces theses locks with user-level objects (critical sections and condition variables.).  This drops the time needed for an uncontended acquire/release by 60% since there is no kernel transition and scheduling.

The patch comes in two flavors.  The current version _emulates_ condition variables on Windows by the same mechanism as I introduced for the new GIL, that is, using a combination of "critical section" objects and a construct made of a "semaphore" and a counter.

Also provided, for those that want, and for future reference, is a version that uses native system objects (windows condition variables and SRWLocks).  I can drop them from the patch to make you happy, but they are dormant and nicely show how conditional compilation can switch in more modern features for a different target architecture.

K

> -----Original Message-----
> From: Martin v. Löwis [mailto:report@bugs.python.org]
> Sent: 30. apríl 2012 09:05
> To: Kristján Valur Jónsson
> Subject: [issue11618] Locks broken wrt timeouts on Windows
> 
> 
> Martin v. Löwis <martin@v.loewis.de> added the comment:
> 
> As it stands, the patch is pointless, and can safely be rejected. We will just
> not have defined NTDDI_VERSION at NTDDI_VISTA for any foreseeable
> future, so all the Vista-specific code can be eliminated from the patch.
> 
> Python had been using dynamic checking for API "forever". In 2.5, there was
> a check for presence of GetFileAttributesExA; in 2.4, there was a check for
> CryptAcquireContextA.
> 
> ----------
> 
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue11618>
> _______________________________________
History
Date User Action Args
2012-04-30 10:03:10kristjan.jonssonsetrecipients: + kristjan.jonsson, loewis, pitrou, tim.golden, brian.curtin, python-dev, sbt
2012-04-30 10:03:09kristjan.jonssonlinkissue11618 messages
2012-04-30 10:03:09kristjan.jonssoncreate