📜  多处理和多线程之间的区别

📅  最后修改于: 2021-09-13 02:45:48             🧑  作者: Mango

多处理多线程都用于增加系统的计算能力。

多处理:
多处理是具有一个或两个以上处理器的系统。在多处理中,增加了 CPU 以提高系统的计算速度。由于多处理,有许多进程同时执行。多处理分为两类:

1. Symmetric Multiprocessing
2. Asymmetric Multiprocessing 

多线程:
多线程是在一个进程中创建多个线程以提高系统计算速度的系统。在多线程中,一个进程的多个线程同时执行,多线程中的进程创建是根据经济性来完成的。

多处理和多线程的区别:

S.NO Multiprocessing Multithreading
1. In Multiprocessing, CPUs are added for increasing computing power. While In Multithreading, many threads are created of a single process for increasing computing power.
2. In Multiprocessing, Many processes are executed simultaneously. While in multithreading, many threads of a process are executed simultaneously.
3. Multiprocessing are classified into Symmetric and Asymmetric. While Multithreading is not classified in any categories.
4. In Multiprocessing, Process creation is a time-consuming process. While in Multithreading, process creation is according to economical.
5. In Multiprocessing, every process owned a separate address space. While in Multithreading, a common address space is shared by all the threads.