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


Groups > comp.lang.python > #45618

Re: Please help with Threading

Date 2013-05-20 07:06 -0400
From Dave Angel <davea@davea.name>
Subject Re: Please help with Threading
References <CAA=1kxR4GD1xLBPJK9sKb_LrVbi-UScBxRbx2vacM989K+YV2Q@mail.gmail.com> <20130520074514.GA33353@cskk.homeip.net> <CAA=1kxSaWQrP+J7ArA8ZW6W6p225q+tsBjRKSuB8hMPBaphaNQ@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.1887.1369047977.3114.python-list@python.org> (permalink)

Show all headers | View raw


On 05/20/2013 03:55 AM, Fábio Santos wrote:
> My use case was a tight loop processing an image pixel by pixel, or
> crunching a CSV file. If it only uses local variables (and probably hold a
> lock before releasing the GIL) it should be safe, no?
>

Are you making function calls, using system libraries, or creating or 
deleting any objects?  All of these use the GIL because they use common 
data structures shared among all threads.  At the lowest level, creating 
an object requires locked access to the memory manager.


Don't forget, the GIL gets used much more for Python internals than it 
does for the visible stuff.


-- 
DaveA

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


Thread

Re: Please help with Threading Dave Angel <davea@davea.name> - 2013-05-20 07:06 -0400

csiph-web