18

What is a thread quantum, and how can I identify it on my system?

C. Ross
  • 31,137
  • 42
  • 147
  • 238

5 Answers5

14

Thread Quantum is the amount of time that the schedule allows a thread to run before scheduling a different thread to run.

What are threads?

Platform Builder: Setting the Default Thread Quantum

As far as editing goes...There is a registry setting in windows that allows priority changing:

HKEY_LOCAL_MACHINE / SYSTEM / CurrentControlSet / Control / PriorityControl / Win32PrioritySeparation

0 Foreground and background applications equally responsive

1 Foreground application more reponsive than background

2 Best foreground application response time

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
NebuSoft
  • 3,962
  • 2
  • 22
  • 24
3

Check out this tutorial on thread quanta and scheduling

In particular:

Each thread has a quantum, which is effectively how long it is allowed to keep hold of the CPU if:

it remains runnable;

the scheduler determines that no other thread needs to run on that CPU instead.

Community
  • 1
  • 1
David Gelhar
  • 27,873
  • 3
  • 67
  • 84
  • the second point seems a bit strange to me, because if no other thread needs to run on that CPU, then there is no need for a quantum, but the thread should just keep hold of the CPU until some other thread needs to run on that CPU – 463035818_is_not_an_ai Aug 08 '17 at 12:34
  • @463035818_is_not_a_number the quantum could be infinite in that case, but it still exists from a theoretical standpoint :) – Dan Bechard Jul 28 '21 at 23:33
2

I don't know how to identify, but I know what a Thread Quantum is.

Multithreading, or parallelism in general, is not "true" parallelism on a single-core computer (nor it is on a dual-core when there are more than 2 threads, nor it is on a quad-core when there are more than 4 threads, etc.).

The Operating System keeps track of a list of threads. Each thread has a priority. The list will execute the topmost thread on the list. The thread will execute for as long as allowed by the Thread Quantum. When a thread is finished executing, it will move down to the bottom of the list.

Thread Quantum will determine how long a thread may run on a sequential system. Higher priority threads have higher Quantums and thus run longer.

Pindatjuh
  • 10,550
  • 1
  • 41
  • 68
1

Give a look at Round Robin Scheduling

http://en.wikipedia.org/wiki/Round-robin_scheduling

I think this may be what you are asking about. quantum is the unit of time give to each process to execute.

Maestro1024
  • 3,173
  • 8
  • 35
  • 52
0

How do you measure length? velocity? mass? It is the same thing with threads and processes.

A quantum is a unit of time. Programmers don't talk about the time that each thread is supposed to work in seconds, milliseconds or microseconds but in abstract unit of time called quantum.

Khaled Alshaya
  • 94,250
  • 39
  • 176
  • 234