I
Ivan Voras
I've read articles about it but I'm not sure I've got everything right. Here
are some statements about the subject that I'm not 100% sure about:
- when interpreter (cpython) is compiled with pthreads, python programs can
make use of multiple processors (other statements below are for
cpython+pthreads environment)?
- the GIL is only placed on global variables (and makes access to global
variables essentially serialized)? (--> if I don't use global variables, I'm
free from GIL?)
- python can make use of multiple IO accessess across threads: if one thread
does file.read(), others are not blocked by it?
- only one thread can do IO access: if one thread does file.read(), others
cannot (they wait until the 1st read() call ends)?
- all of the above stays the same for network IO (socket.read())?
- all of the above is true for any call to a C function?
Can someone say which statements are true, which are false (and an
explanation of what is more correct )?
Thanks!
are some statements about the subject that I'm not 100% sure about:
- when interpreter (cpython) is compiled with pthreads, python programs can
make use of multiple processors (other statements below are for
cpython+pthreads environment)?
- the GIL is only placed on global variables (and makes access to global
variables essentially serialized)? (--> if I don't use global variables, I'm
free from GIL?)
- python can make use of multiple IO accessess across threads: if one thread
does file.read(), others are not blocked by it?
- only one thread can do IO access: if one thread does file.read(), others
cannot (they wait until the 1st read() call ends)?
- all of the above stays the same for network IO (socket.read())?
- all of the above is true for any call to a C function?
Can someone say which statements are true, which are false (and an
explanation of what is more correct )?
Thanks!