August  Larson

August Larson


Multithreading vs. Multiprocessing in Python

Part I Talking In Theory

Before we start discussing multithreading and multiprocessing, let me briefly introduce what is **process **and thread in computer and program:

  • A process is what we call a program that has been loaded into memory along with all the resources it needs to operate.
  • A thread is the unit of execution within a process.
  • A process can have multiple threads running as a part of it, each thread uses the process’s memory space and shares the same memory space with other threads while the processes have separate memory.

After knowing the relationship between processes and threads, now we could forward to dig into the details of them as well as practically using python code to see how they speed up the program.

#multiprocessing #threads #multithreading #programming #python #multithreading vs. multiprocessing in python

Multithreading vs. Multiprocessing in Python