-4
0
I need to know what kind of thread management Windows and Debian / Red Hat use in their recent versions.
I know that they used to use 1 to 1 thread management model. Do they still use this model to this day? Or did they change it?
-4
0
I need to know what kind of thread management Windows and Debian / Red Hat use in their recent versions.
I know that they used to use 1 to 1 thread management model. Do they still use this model to this day? Or did they change it?
0
The win32 API supports both the one-to-one and many-to-many models (in the thread library and fiber library respectively).
Windows 7, like all of the NT family, supports the win32 API.
Windows 7 supports kernel threads. So it must be a one to one model or many to many model. But it is in fact a hybrid that supports both models. By default it will use traditional one to one scheduling, but depending on the number of scheduling entities available to the OS (based on the number of processors and cores), you can force it into a many to many scheduler. The operating system itself will never shift automatically. You must explicitly tell it to.
Note that the 32bit version of Windows 7 does not support M:N scheduling. Only the 64bit version.
Linux can also support M:N through libraries like RIBS2, just as windows would through the fiber API.
Hybrid is always better because you have an option to optimize thread scheduling, whereas before you had only one choice. But to take actual advantage of a many to many scheduler is another matter altogether. It will greatly depend on your need for a very large number of threads and what they are actually doing. I don't know the exact details though, since I was never involved in high performance projects with the need to create a very large number of threads. It is my understanding however that programming the threads becomes simpler, but managing them becomes harder. In particular you spend a lot of time in the testing phase trying to optimize your threads to the much more complex scheduler.
Prior to Windows 7, Windows used a one to one user thread to kernel thread relationship. It was of course always possible to cobble together a rough many to one user-scheduler (this can be done in pretty much any OS with user-level timer interrupts) but if a system call blocked on any one of the user threads it would block the kernel thread and accordingly block all other user threads on the same scheduler. Naturally, a many to one model cannot take advantage of SMP.
With Windows 7, Microsoft introduced support for user-mode scheduling. A program may configure one or more kernel threads as a scheduler (one per logical processor desired) and then create a user-mode thread pool from which these UMS can draw. The kernel maintains a list of outstanding system calls which allows the UMS to continue running without blocking the kernel thread. This configuration can be used as either many to one or many to many.
entirely different models. – Ramhound – 2014-11-03T19:46:37.227
entirely different models is not an answer, I am researching and need an starting point, vague answers or implications are of no use. – Rika – 2014-11-04T03:06:26.307
Ramhound did not post an answer, but a comment. I'm not sure if this question isn't a little too broad. Are you looking for specific references? If so, please clarify what exactly you need to know. – slhck – 2014-11-04T10:14:32.827
I'm not sure what you're asking exactly. Operating systems don't really have thread management models. – David Schwartz – 2014-11-04T10:39:03.793
@Hossein - Vague answers come from broad and overreaching questions. Saying that Windows and Linux use two different thread management models is an acceptable response. – Ramhound – 2014-11-04T11:52:26.680
@slhck: I believe the question was indeed clear enough not get down voted or called too broad! the reason for that is i asked the same question in several places, and got the answers i was looking for. in none of those places i faced such behavior! which i guess is because of my low score in this section. I am well aware of the rules here after 3 years! so that doesnt count if you ask me . Any way, Thank you very much for your concerns – Rika – 2014-11-04T18:39:16.577
Well, certainly you may believe that it's clear enough, but it's often a huge difference how a question looks to others who might know the answer but aren't quite sure about what exactly you mean. I wouldn't go as far as calling out users for their "behavior" here. I only see users asking for clarification. Of course I understand that you're upset about the downvotes. Note that we just have a very strong focus on questions that are about solving a specific problem, which obviously is not the case here. – slhck – 2014-11-04T18:51:07.860