[Python-ideas] Add faster locks to the threading module?
Sturla Molden
sturla at molden.no
Wed Jul 21 03:08:26 CEST 2010
Den 21.07.2010 02:57, skrev Jesse Noller:
>
> Regardless of the rest of the proposal (which I'm not keen on; I don't
> want to rely on the GIL "being there") you need to factor the newgil
> code into this equation as a change like this would only land in the
> 3.x branch. With 2.7 out the door - 3.x is, for all effective
> purposes, trunk.
>
>
Yes, but the principle of denying other threads access to the GIL for
fast synchronization still applies to 3.x.
Java has "synchronized" blocks too. This is not very different. But
monopolizing the GIL is much faster than a lock if the purpose is just
to guard a tiny piece of code.
Sturla
More information about the Python-ideas
mailing list