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/2003-February/033280.html below:

[Python-Dev] Re: Atomic operations

[Python-Dev] Re: Atomic operations [Python-Dev] Re: Atomic operationsSkip Montanaro skip@pobox.com
Mon, 10 Feb 2003 08:25:38 -0600
    Brett> I was actually thinking more along the lines of having something
    Brett> like::

    Brett>  atomic:
    Brett>      lock()
    Brett>  ...

    Brett> with atomic basically shutting down threading temporarily until
    Brett> everything in its body is executed.  

This would presumably generate bytecode something like:

    GRAB_GIL
    lock()
    ... execute the block's code ...
    unlock()
    RELEASE_GIL

Suppose code in your block makes a call to a threading-aware extension
module.  Won't it obligingly release the GIL if it goes to do some longish
operation?  If so, wouldn't you then be screwed?

Skip



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