C
C
coder2021-07-28 18:45:16
Operating Systems
coder, 2021-07-28 18:45:16

Do I understand correctly?

For example, we have a processor (2 cores and 4 threads), an OS, a process A (3 threads) and a process B (2 threads). 4 streams can work at the same time. That is, the OS will constantly switch between processes and each process will
not use all the processor threads? Is there a limit on the number of threads a process can have?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
Wataru, 2021-07-28
@RomanSamets

The OS will run 4 threads every time quantum. On which cores and which exactly four of the three threads A and two B or countless system threads - the system task scheduler decides.
Imagine that the system has a processor with one core and one thread. Then the system can start threads like this - 10µs A1, 10µs B1, 10µs A2, 10µs B2, 10µs A3, 10µs A1, 10µs B1 ...
For four logical cores, for example, 10µs {A1,A2,B1,B2} , 10µs {A1,A3,B1,B2}...

T
tormozillo, 2021-07-28
@tormozillo

I will add to the previous answers, tk. there are 2 cores, then in addition to the OS scheduler, there will still be switching between 2 threads at the level of processor cores.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question