Time quantum for each process per thread

I have a question related to the time quantum asked for processes and threads in windows and linux.

I know that operating systems as a whole give a fixed number of time slices for each thread. (I know temporary quantum changes depending on the background or background threads. May also change depending on the priority of the process.)

Is there a fixed time slice for each process? E.g. If the OS gives 36 time quanta for each process, and if the process has 2 threads, then each will receive 18 quanta. If the number of threads becomes 3, each will get 12.

However, if there is no fixed quantum for each process, and the OS gives a fixed quantum for the thread (there is no dependence on the parent process.), Then I can make my process more efficient by creating several threads. (Assuming I don't have my two mutex / semaphores in my code.)

I have an application that runs on both OS (Windows and Linux). Therefore, I ask for this in a general sense.

thanks

+6
source share
2 answers

In linux, from a planning perspective, threads and processes are equivalent. Therefore, if a process spawns two threads, each should receive 36 quanta. Although I would like to hear this from someone with greater certainty than mine, to confirm.

+1
source

Pretty interesting question :)

I actually do not have accurate data, but from the link below you can see that the modern OS has an evaluation-based thread planning method.

http://technet.microsoft.com/en-us/magazine/2007.02.vistakernel.aspx

+1
source

Source: https://habr.com/ru/post/923712/


All Articles