Re: Please help with Threading

Discussion in 'Python' started by Dave Angel, May 20, 2013.

  1. Dave Angel

    Dave Angel Guest

    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
     
    Dave Angel, May 20, 2013
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. KK
    Replies:
    2
    Views:
    649
    Big Brian
    Oct 14, 2003
  2. Replies:
    9
    Views:
    1,078
    Mark Space
    Dec 29, 2007
  3. silkenpy
    Replies:
    1
    Views:
    355
    Dennis Lee Bieber
    Feb 15, 2008
  4. Steven Woody
    Replies:
    0
    Views:
    443
    Steven Woody
    Jan 9, 2009
  5. Steven Woody
    Replies:
    0
    Views:
    464
    Steven Woody
    Jan 9, 2009
Loading...

Share This Page