[Python-Dev] User + sys time bigger than real time, in case of no real parallelism

Stefan Ring stefanrin at gmail.com
Sun Feb 5 03:58:51 EST 2017

> That is usually what I can expect in case of tasks executed in parallel on
> different CPUs. But my example should not be the case, due to the GIL. What
> am I missing? Thank you very much, and sorry again for the OT :(

With such finely intermingled thread activity, there might be a fair
bit of spinlock spinning involved. Additionally, I suspect that the
kernel does not track CPU time at microsecond precision and will tend
to round the used times up.

Obviously, this is not a reasonable way to use threads. The example is
only effective at producing lots of overhead.

More information about the Python-Dev mailing list