Will multithreading make python less popular?

sturlamolden sturlamolden at yahoo.no
Fri Feb 20 11:36:14 CET 2009

On Feb 20, 12:19 am, Mensanator <mensana... at aol.com> wrote:

> What am I actually seeing? If Python only uses one of the cores,
> why do both light up?

Because of OS scheduling. You have more than one process running. The
Python process does not stay on one core. Try to put CPython into a
tight loop ("while 1: pass"). You will see ~50% use of both cores. If
you had 4 cores, you would see ~25% use.

> Is everything much more complicated (due to
> OS scheduling, etc.) than the simple explanations of GIL?

No. Your Python code cannot use more than one core simultaneously.
It's just that scheduling happens so fast and so often that you don't
notice it.

More information about the Python-list mailing list