📜  进程争用范围和系统争用范围的区别

📅  最后修改于: 2022-05-13 01:56:11.758000             🧑  作者: Mango

进程争用范围和系统争用范围的区别

1.进程争用范围
在操作系统中,线程库由称为内核线程的操作系统调度,该操作系统由线程库管理,用于用户级线程运行可用的轻量级进程。这通常称为进程争用范围。

进程争用范围根据优先级执行,这意味着调度程序首先选择或检查具有最高优先级的线程来运行。

程序员设置线程库未调整的用户级线程优先级。还有一些线程库允许程序员改变线程的优先级。

2. 系统争用范围:
在操作系统中,系统争用范围是操作系统中使用的两种线程调度方案之一。内核使用此方案来决定将哪个内核级线程调度到 CPU 中,这使用系统争用范围,其中系统内的所有线程都争用 CPU。这通常称为系统争用范围。

系统使用一对一模型,如 windows,Linux 仅使用系统争用范围来调度线程。



进程争用范围和系统争用范围的区别:

S.no    

Process Contention Scope

System Contention Scope

1.Process contention scope is commonly known local scheduling on unbound threads.System contention scope commonly is known as global scheduling on bound threads.
2.Process contention scope use many-to-many and many-to-one model in it.System contention scope use one-to-one model in it.
3.In process contention scope, there is a competition for the usage of the CPU that takes place between threads that are equivalent to processes.In system contention scope, there is a competition for the usage of the CPU that takes place among all the threads in an operating system.
4.Process contention scope use N :1 or N : M thread model relationship. System contention scope thread use 1 :1 thread model relationship with a kernel thread. 
5.It is mostly used in windows, Linux, and Solaris threads.It is mostly used in Linux threads.
6.Process contention scope or local contention scope is a user level thread that shares a kernel thread with other users thread within the process.System contention scope or global contention scope is a user thread which is mapped directly to one kernel thread. 
7.In process contention scope, the thread library has real control over which user level thread is to be scheduled on an light weight process. In system contention scope, operating system provides kernel level thread, i.e. kennel decides which thread is to be scheduled into a CPU.
8.In process contention scope all the scheduling mechanism for the thread is local to the processes.In system contention scope, all the scheduling mechanism for the thread is global to the processes.
9.Process contention scope is very cheaper than system contention scope System contention scope is very predictable because of high processing cost.
10.Process contention scope, thread shares one or more available light weight processes.System contention scope threads, shares separate light weight processes.