GIL release

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Alastair Basden

    #1

    GIL release

    Hi,
    Does anyone know whether there is a way for a python thread to release
    the global interpreter lock, and let all other threads have a chance at
    running before re-acquiring it? Does the thread scheduling follow a
    round-robin method?

    Thanks,
    agb.
  • Armin Steinhoff

    #2
    Re: GIL release

    Alastair Basden wrote:[color=blue]
    > Hi,
    > Does anyone know whether there is a way for a python thread to release
    > the global interpreter lock, and let all other threads have a chance at
    > running before re-acquiring it? Does the thread scheduling follow a
    > round-robin method?[/color]

    The thread itself are scheduled by the OS ... the access to the GIL is
    managed by 'cooperative scheduling'.

    --Armin
    [color=blue]
    >
    > Thanks,
    > agb.[/color]

    Comment

    • Pierre Barbier de Reuille

      #3
      Re: GIL release

      Do you mean in Python or in C ?

      In C this is described in details in the documentation. In Python, I
      don't think there is a way ! If you want to do so you'll want to use a
      micro sleep ...

      Pierre

      Alastair Basden a écrit :[color=blue]
      > Hi,
      > Does anyone know whether there is a way for a python thread to release
      > the global interpreter lock, and let all other threads have a chance at
      > running before re-acquiring it? Does the thread scheduling follow a
      > round-robin method?
      >
      > Thanks,
      > agb.[/color]

      Comment

      Working...