每线程处理时间量子 [英] Time quantum per process per thread
问题描述
我有关于Windows和Linux环境提供给进程和线程时间段的问题。
I have a question pertaining to time quantum given to processes and threads in windows and linux.
我知道一般的操作系统给每个线程时间量的固定金额。 (我知道这取决于前台或后台线程时间量的变化。根据进程的优先级也可能改变。)
I know operating systems in general give a fixed amount of time quantum per thread. (I know time quantum changes depending on foreground or background threads. May also change depending on the priority of a process.)
有每个进程的一个固定的时间段?对于如。如果操作系统给每个进程36时间段,如果一个进程有2个线程然后各自将获得18量子。如果线程数变为3则每个将获得12
Is there a fixed time quantum per process? For eg. If OS gives 36 time quantum per process and if a process has 2 threads then each will get 18 quantum. If number of threads becomes 3 then each will get 12.
但是,如果每个进程的一个固定的量子不存在和操作系统提供固定每个线程量子(父进程没有依赖性。),那么我或许可以让我的过程更有效率通过产生多个线程。(假设我不在我的code两个多互斥/信号灯)。
However, if a fixed quantum per process does not exist and OS gives fix quantum per thread(No dependency on the parent process.) then I may be able to make my process more efficient by spawning multiple threads.(Assuming I dont have two many mutex/semaphores in my code.)
我有台同时运行的操作系统(Windows和Linux)上的应用程序。所以,我要求它在一般意义上。
I have an application which runs on both OS(Windows and linux). So, I am asking it in a general sense.
感谢
推荐答案
一个相当有趣的问题:)
Quite an interesting question :)
我真的没有确切的细节,但是从下面的链接,你可以看到,现代的操作系统有线程调度的估计为基础的方法。
I do not really have the exact details, but from the link below you can see that the modern OS has an estimate based method of thread scheduling.
http://technet.microsoft.com/en-us/杂志/ 2007.02.vistakernel.aspx
这篇关于每线程处理时间量子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!