Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

As far as I can tell, both use:

  • Multilevel feedback queue
  • Priority levels (different range)
  • Both manage threads and not the process

But what are the big differences?

share|improve this question

migrated from Apr 20 '12 at 4:19

This question came from our site for professional and enthusiast programmers.

Are you convinced that that there are any, at least when Linux is supplied and installed as one of the common distros and no rebuilding/reconfiguring has been done? – Martin James Apr 19 '12 at 22:09
According to the Wikipedia page and the chapter on scheduling of the book I'm reading there is but mostly linux is covered and barely anything about Windows. Also, there seems to be differences between kernel versions under linux and even between XP / Vista / 7 on Windows so I'm just looking for some general differences, if any. – Chris911 Apr 19 '12 at 22:16
Big differences? ... well, for one Linux gives you the choice among various, if you like. But I think the question is too broad to be answered in any useful manner. BTW: you should definitely clarify that you mean the thread scheduler, not cron and its alternatives on Linux and Windows. – 0xC0000022L Apr 19 '12 at 23:08
Also, note that Linux has many schedulers. Most notable are the Completely Fair Scheduler and Brain Scheduler. – new123456 Apr 20 '12 at 22:25
you may have to ask re windows. ask re linux. study both. figure out differences. could ask more tech questions that perhaps aren't too os specific, on a computer science stackexchange site. What book are you reading? william stalling has a great book on OSs that covers scheduling but i don't think it goes OS specific – barlop Nov 17 '14 at 14:34

3 Answers 3

up vote 3 down vote accepted

According to Scheduling Priorities at MSDN:

Threads are scheduled to run based on their scheduling priority. Each thread is assigned a scheduling priority. The priority levels range from zero (lowest priority) to 31 (highest priority). Only the zero-page thread can have a priority of zero. (The zero-page thread is a system thread responsible for zeroing any free pages when there are no other threads that need to run.)

The system treats all threads with the same priority as equal. The system assigns time slices in a round-robin fashion to all threads with the highest priority. If none of these threads are ready to run, the system assigns time slices in a round-robin fashion to all threads with the next highest priority. If a higher-priority thread becomes available to run, the system ceases to execute the lower-priority thread (without allowing it to finish using its time slice), and assigns a full time slice to the higher-priority thread. The priority of each thread is determined by the following criteria:

  • The priority class of its process
  • The priority level of the thread within the priority class of its process

I believe this thread scheduler describes an algorithm called multilevel queue, which is a much simpler scheduling algorithm than multilevel feedback queue. Note that Windows' process scheduler uses multilevel feedback queue, according to Wikipedia. Since Windows 7 and Windows Server 2008 R2, there is also User-Mode Scheduling which lets processes manage their own threads scheduling.

As mentioned by others, Linux treats process and threads the same from scheduling perspective. Process/thread scheduling in Linux is configurable, there are various scheduling algorithms and some can be configured by recompiling the kernel:

Note that default above means default in vanilla kernel. Some distros ship with a default kernel that is preconfigured to use different default scheduler.

In addition to the scheduling algorithm, there are also scheduler policies: SCHED_FIFO, SCHED_BATCH, SCHED_IDLE, SCHED_OTHER, and SCHED_RR; which can be changed at runtime which describes the kind of workload that a process has.

The current default scheduler Completely Fair Scheduler, uses a red-black tree to maintain scheduling fairness. From Inside the Linux 2.6 Completely Fair Scheduler:

The main idea behind the CFS is to maintain balance (fairness) in providing processor time to tasks. This means processes should be given a fair amount of the processor. When the time for tasks is out of balance (meaning that one or more tasks are not given a fair amount of time relative to others), then those out-of-balance tasks should be given time to execute.

To determine the balance, the CFS maintains the amount of time provided to a given task in what's called the virtual runtime. The smaller a task's virtual runtime—meaning the smaller amount of time a task has been permitted access to the processor—the higher its need for the processor. The CFS also includes the concept of sleeper fairness to ensure that tasks that are not currently runnable (for example, waiting for I/O) receive a comparable share of the processor when they eventually need it.

But rather than maintain the tasks in a run queue, as has been done in prior Linux schedulers, the CFS maintains a time-ordered red-black tree (see Figure 1). A red-black tree is a tree with a couple of interesting and useful properties. First, it's self-balancing, which means that no path in the tree will ever be more than twice as long as any other. Second, operations on the tree occur in O(log n) time (where n is the number of nodes in the tree). This means that you can insert or delete a task quickly and efficiently.

So main differences:


  • Process scheduling using Multilevel feedback queue + Thread scheduling using Multilevel queue. The thread scheduler simply picks the highest priority thread, the process scheduler is smarter and uses feedback queue.


  • Unified process and thread scheduler, configurable, by default uses CFS. The scheduler uses a metric of fairness and uses priority to skew the distribution of CPU to higher priority processes.
share|improve this answer
But Winoows processes are not units of execution; they are containers for resources (including, if the process is running, at least one thread). Drawing a distinction between process scheduling and thread scheduling seems wrong to me. I think that your first source is either oversimplified or out of date, and you may be reading too much into the Wikipedia entry. The only way a process interacts with the scheduler is by providing a baseline priority for its threads. – Ian Ni-Lewis Oct 20 at 14:14

If you are refering to the kernel scheduler (and not a periodic task scheduler like some comments suggest), in Linux is pretty easy: in terms of scheduling, Linux makes no difference between threads and processes. From the kernel point of view, they are just scheduling units; the difference relies in the weight of the context switch. This is sometimes called a one-to-one threading model.

As there is less information available regarding Windows internals, little can be said. However, Windows has historically differentiated between processes and threads so it is more likely that they are treated differently in terms of scheduling.

share|improve this answer

C2H5OH, Why would you say there's no documentation on Windows Internals when everything is available? Beats me... You can read the most of the basics here,

There's an article on Wikipedia (Threads (computing)) which states most of the differences, but without cited sources, so...

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.