How many threads are running at the same time? One per core. I have 4 cores, so there are effectively 4 units of independent code running in parallel.
Having 4 cores is irrelevant as the python threads can only utilize one logical core due to the GIL. The only possible way to release the GIL is using the C API, but it’s not advisable.
Python's I/O primitives are written with the C API.
They release the GIL when they are waiting for I/O, so in those moments when you're waiting for I/O, your program, for a little while is technically parallel.
A few moments of pure parallelism ;-)
So no, having multiple cores is not completely irrelevant.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Having 4 cores is irrelevant as the python threads can only utilize one logical core due to the GIL. The only possible way to release the GIL is using the C API, but it’s not advisable.
Python's I/O primitives are written with the C API.
They release the GIL when they are waiting for I/O, so in those moments when you're waiting for I/O, your program, for a little while is technically parallel.
A few moments of pure parallelism ;-)
So no, having multiple cores is not completely irrelevant.