- Experiment to demonstrate python concurrency and parallelism.
- Also demonstrates python's Global Interpreter Lock (GIL)
$ python concurrency.py
single threaded execution:
cpu_heavy_function: 9.6495 seconds
io_heavy_function: 10.0385 seconds
multi threaded execution
cpu_heavy_function: 8.0159 seconds
io_heavy_function: 1.0063 seconds
multi process execution
cpu_heavy_function: 1.6688 seconds
io_heavy_function: 1.1188 seconds