An open API service indexing awesome lists of open source software.

https://github.com/qedsoftware/python-parallelism-test

Experiments with threads vs. processes in Python.
https://github.com/qedsoftware/python-parallelism-test

Last synced: 2 months ago
JSON representation

Experiments with threads vs. processes in Python.

Awesome Lists containing this project

README

          

THREADS VS. PROCESSES IN PYTHON
========================================
This small example compares multithreading and multiprocessing.

To test multi-threading, which works better for I/O-bound applications due to the Global Interpreter Lock:

$ time python test-thread.py

To test multi-processing, which works better for CPU-bound applications:

$ time python test-multiproc.py

Source: http://www.martinkral.sk/blog/2011/03/python-multicore-vs-threading-example/