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


Groups > comp.lang.python > #45618 > unrolled thread

Re: Please help with Threading

Started byDave Angel <davea@davea.name>
First post2013-05-20 07:06 -0400
Last post2013-05-20 07:06 -0400
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#45618 — Re: Please help with Threading

FromDave Angel <davea@davea.name>
Date2013-05-20 07:06 -0400
SubjectRe: Please help with Threading
Message-ID<mailman.1887.1369047977.3114.python-list@python.org>
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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web