1. 多道程序:
多道程序是一次运行多个进程,它通过组织作业(代码和数据)来提高 CPU 利用率,以便 CPU 始终有一个要执行。动机是在主内存中保留多个作业。如果一个作业被输入/输出占用,则 CPU 可以分配给其他作业。
2. 多线程:
多线程是一种通过为一个进程创建多个线程以提高系统计算速度的技术。在多线程中,一个进程的多个线程同时执行,多线程中的进程创建是根据经济性来完成的。
多道程序和多线程之间的区别:
S.No. | Multiprogramming | Multithreading |
---|---|---|
1. | The concurrent application of more than one program in the main memory is called as multiprogramming. | The process is divided into several different sub-processes called as threads, which has its own path of execution. This concept is called as multithreading. |
2. | It takes more time to process the jobs. | It takes moderate amount of time for job processing. |
3. | In this, one process is executed at a time. | In this, various components of the same process are being executed at a time. |
4. | The number of users is one at a time. | The number of users usually one. |
5. | Throughput is less. | Throughput is Moderate. |
6. | Its efficiency is Less. | Its efficiency is moderate. |
7. | It is economical. | It is economical. |
8. | The number of CPU is one. | The number of CPU can be one or more than one. |