Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #46526

Re: Python and GIL

References <loom.20130530T200750-839@post.gmane.org>
Date 2013-05-31 04:30 +1000
Subject Re: Python and GIL
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.2442.1369938658.3114.python-list@python.org> (permalink)

Show all headers | View raw


On Fri, May 31, 2013 at 4:14 AM, Ana Marija Sokovic
<sokovic.anamarija@gmail.com> wrote:
> Hi,
>
> Can somebody explain to me how would you proceed in releasing the GIL and
> whether you think it will have consequences?

You release the GIL in C-level code when you don't need to work with
Python objects for a while. Simple example is when you need to wait
for something - for instance, if you attempt to read from a pipe, you
can release the GIL before reading, then reacquire it afterward. The
consequence is that you can't do anything with Python objects till you
reacquire it. It's like any other resource-guarding mutex lock.

ChrisA

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Python and GIL Chris Angelico <rosuav@gmail.com> - 2013-05-31 04:30 +1000

csiph-web