A Zoomable Interactive Python Thread Visualization
David M Beazley (http://www.dabeaz.com)
Four Threads Executing on 1, 2, and 4 CPUs (OS-X)
The following visualizations show thread scheduling of four CPU-bound
threads on a single CPU versus that on 2 and 4 CPUs. Observe how
thread switching gets more rapid as the number of CPUs increases.
Zoom in to see all sorts of crazy GIL contention. You can also view a
Linux version of this page.
OS-X, 4 Threads, 1 CPU [ code ]
+
-
Acquired and running
Busy
Retry
OS-X, 4 Threads, 2 CPUs [ code ]
+
-
Acquired and running
Busy
Retry
OS-X, 4 Threads, 4 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
- OS-X 10.6.2 (Snow Leopard)
- The number of CPU cores was controlled using the Processor
Preference Pane
Take Me To More Visualizations!