r/eli5_programming • • Sep 25 '21

Explanation ELI5 multithreading vs multiprocessing

Explain like I'm 5 the difference between multi threading and multi processing. And maybe the concept of processor, core, threads :)

4 Upvotes

3 comments sorted by

View all comments

Show parent comment

5

u/DrMaxim Sep 25 '21

Actually this is not correct. Processes and threads are concepts that are transparent to the underlying CPU architecture. You can have BOTH concepts on single core as well as on multicore systems.

The real difference lies in the definitions of the concepts of threads and processes. A process is a really have entity, holding the program code, memory and other resources that is executed on a computing unit (not necessary specific even to CPUs you have processes and threads on GPUs as well). A thread is a piece of code that exists within a process. So multiple threads of the same process share their resources but two processes are distinct entities and typically do not share resources (although they can over methods such as shared memory).