GIL release

A

Alastair Basden

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.
 
A

Armin Steinhoff

Alastair said:
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?

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

--Armin
 
P

Pierre Barbier de Reuille

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 :
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,218
Latest member
JolieDenha

Latest Threads

Top