A Zoomable Interactive Python Thread Visualization
David M Beazley (http://www.dabeaz.com)
Two Threads Executing on 1 and 2 CPUs (Linux)
The following visualizations show thread scheduling of two CPU-bound
threads on a single CPU versus that on two CPUs. Observe how
thread switching is much more rapid with multiple CPUs. Zoom in
to see the infamous GIL battle in action. You can also view a
OS-X version of this page.
Linux, 2 Threads, 1 CPU [ code ]
+
-
Acquired and running
Busy
Retry
Linux, 2 Threads, 2 CPUs [ code ]
+
-
Acquired and running
Busy
Retry
Test Details
Tests were conducted on the following system:
- Python 2.6
- MacPro 2 x 2.66 Ghz Dual-Core Intel Xeon, 3GB 667 Mhz DDR2
FB-DIMM
- VMWare Fusion 2.0.6 with 4 CPU cores enabled.
- Ubuntu 9.04 (Jaunty), Kernel Linux 2.6.28-15-generic
- The number of CPU cores was controlled by changing their status in /sys/devices/system/cpu.
Take Me To More Visualizations!