Electron microscopy
 
Comparison between Multithreading, Multiprocessing and Asyncio in Python
- Integrated Circuits -
- An Online Book -
Integrated Circuits                                                                                   http://www.globalsino.com/ICs/        


=================================================================================

 

Multithreading:
         It is easier to share resources, and it is often used to IO based tasks. However, it is not so good in CPython to CPU bound jobs because other CPU cores cannot be used, and GIL is slowing the process.

Multiprocessing:
         It can take full advantage of CPU cores instead of being attached to one core with threads, write to many disks simultaneously. However, it wastes a lot of RAM because each process has to load all the libraries again. In addition, it is harder to maintain code and it's harder to synchronize your jobs now.

Asyncio:
         It means that Python can't start new thread. The thread now starts behaving like a boss: do that for me and when you finished get back here.

 

 

=================================================================================