A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2011-August/112864.html below:

[Python-Dev] GIL removal question

[Python-Dev] GIL removal question [Python-Dev] GIL removal questionSturla Molden sturla at molden.no
Sun Aug 14 03:53:15 CEST 2011
Den 13.08.2011 17:43, skrev Antoine Pitrou:
> These days we have PyGILState_Ensure():
> http://docs.python.org/dev/c-api/init.html#PyGILState_Ensure
>
With the most recent Cython (0.15) we can just do:

    with gil:
<suite>

to ensure holding the GIL.

And similarly from a thread holding the GIL

    with nogil:
<suite>

to temporarily release it.

There are also some OpenMP support in Cython 0.15. OpenMP is much easier 
than messing around with threads manually (it moves all the hard parts 
of multithreading to the compiler). Now Cython almost makes it look 
Pythonic:

http://docs.cython.org/src/userguide/parallelism.html


Sturla


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4