[Python-ideas] Add faster locks to the threading module?

Sturla Molden sturla at molden.no
Wed Jul 21 02:59:58 CEST 2010


Den 21.07.2010 02:51, skrev Sturla Molden:
>
> Therefore I think both a spinlock and a gillock should be added to the 
> threading module. These are synchronization methods that should be 
> available.
>

Avtually, a spinlock would probably not even be feasible in Python: The 
GIL is a mutex, and we would have to give it up before we could spin on 
the lock, and reacquire afterwards. So the cost of a kernel mutex object 
is still there. The gillock is possibly the only way of getting a fast 
lock object in Python.

Sturla
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20100721/298bce61/attachment.html>


More information about the Python-ideas mailing list