Does software threads include user threads?
up vote
0
down vote
favorite
From this answer - software threads vs hardware threads, software threads are threads managed by OS. But I also learn another term called user threads, which are threads that's not kernel threads, i.e. the OS won't know about these threads. So does software threads include user threads?
I didn't get any answer from stackoverflow, but I think the idea is the same in the context of Linux, I'm asking about the term used in Linux, thanks.
For reference, I found an useful resource on Quora.
linux thread
|
show 2 more comments
up vote
0
down vote
favorite
From this answer - software threads vs hardware threads, software threads are threads managed by OS. But I also learn another term called user threads, which are threads that's not kernel threads, i.e. the OS won't know about these threads. So does software threads include user threads?
I didn't get any answer from stackoverflow, but I think the idea is the same in the context of Linux, I'm asking about the term used in Linux, thanks.
For reference, I found an useful resource on Quora.
linux thread
Why do you make the assumption that the OS does not know about 'user threads'? If I runps
, my OS shows me information about user threads/processes. I believe you are confusing threads with kernelspace/userspace.
– Panki
Dec 6 at 7:33
@Panki: Why do you make the assumption that the OS does not know about 'user threads'? it's from a book I read, and it says in case of many to one model, OS only knows the "one" part, and don't about the "many" part.
– ptr_user7813604
Dec 6 at 7:35
@ptr_user7813604 You ask this question with the assumption that the OS can't see user processes, which is wrong. Hardware threads refers to the "physical" threads your CPU can execute in parallel. So yes, software threads include userland processes.
– Panki
Dec 6 at 7:41
@StephenKitt: Sorry sir, it's not in english, I'm not english learner.
– ptr_user7813604
Dec 6 at 7:48
2
@Panki some userspace threading models are invisible to the kernel (they use an in-process scheduler).
– Stephen Kitt
Dec 6 at 7:48
|
show 2 more comments
up vote
0
down vote
favorite
up vote
0
down vote
favorite
From this answer - software threads vs hardware threads, software threads are threads managed by OS. But I also learn another term called user threads, which are threads that's not kernel threads, i.e. the OS won't know about these threads. So does software threads include user threads?
I didn't get any answer from stackoverflow, but I think the idea is the same in the context of Linux, I'm asking about the term used in Linux, thanks.
For reference, I found an useful resource on Quora.
linux thread
From this answer - software threads vs hardware threads, software threads are threads managed by OS. But I also learn another term called user threads, which are threads that's not kernel threads, i.e. the OS won't know about these threads. So does software threads include user threads?
I didn't get any answer from stackoverflow, but I think the idea is the same in the context of Linux, I'm asking about the term used in Linux, thanks.
For reference, I found an useful resource on Quora.
linux thread
linux thread
edited Dec 8 at 18:11
asked Dec 6 at 7:31
ptr_user7813604
1186
1186
Why do you make the assumption that the OS does not know about 'user threads'? If I runps
, my OS shows me information about user threads/processes. I believe you are confusing threads with kernelspace/userspace.
– Panki
Dec 6 at 7:33
@Panki: Why do you make the assumption that the OS does not know about 'user threads'? it's from a book I read, and it says in case of many to one model, OS only knows the "one" part, and don't about the "many" part.
– ptr_user7813604
Dec 6 at 7:35
@ptr_user7813604 You ask this question with the assumption that the OS can't see user processes, which is wrong. Hardware threads refers to the "physical" threads your CPU can execute in parallel. So yes, software threads include userland processes.
– Panki
Dec 6 at 7:41
@StephenKitt: Sorry sir, it's not in english, I'm not english learner.
– ptr_user7813604
Dec 6 at 7:48
2
@Panki some userspace threading models are invisible to the kernel (they use an in-process scheduler).
– Stephen Kitt
Dec 6 at 7:48
|
show 2 more comments
Why do you make the assumption that the OS does not know about 'user threads'? If I runps
, my OS shows me information about user threads/processes. I believe you are confusing threads with kernelspace/userspace.
– Panki
Dec 6 at 7:33
@Panki: Why do you make the assumption that the OS does not know about 'user threads'? it's from a book I read, and it says in case of many to one model, OS only knows the "one" part, and don't about the "many" part.
– ptr_user7813604
Dec 6 at 7:35
@ptr_user7813604 You ask this question with the assumption that the OS can't see user processes, which is wrong. Hardware threads refers to the "physical" threads your CPU can execute in parallel. So yes, software threads include userland processes.
– Panki
Dec 6 at 7:41
@StephenKitt: Sorry sir, it's not in english, I'm not english learner.
– ptr_user7813604
Dec 6 at 7:48
2
@Panki some userspace threading models are invisible to the kernel (they use an in-process scheduler).
– Stephen Kitt
Dec 6 at 7:48
Why do you make the assumption that the OS does not know about 'user threads'? If I run
ps
, my OS shows me information about user threads/processes. I believe you are confusing threads with kernelspace/userspace.– Panki
Dec 6 at 7:33
Why do you make the assumption that the OS does not know about 'user threads'? If I run
ps
, my OS shows me information about user threads/processes. I believe you are confusing threads with kernelspace/userspace.– Panki
Dec 6 at 7:33
@Panki: Why do you make the assumption that the OS does not know about 'user threads'? it's from a book I read, and it says in case of many to one model, OS only knows the "one" part, and don't about the "many" part.
– ptr_user7813604
Dec 6 at 7:35
@Panki: Why do you make the assumption that the OS does not know about 'user threads'? it's from a book I read, and it says in case of many to one model, OS only knows the "one" part, and don't about the "many" part.
– ptr_user7813604
Dec 6 at 7:35
@ptr_user7813604 You ask this question with the assumption that the OS can't see user processes, which is wrong. Hardware threads refers to the "physical" threads your CPU can execute in parallel. So yes, software threads include userland processes.
– Panki
Dec 6 at 7:41
@ptr_user7813604 You ask this question with the assumption that the OS can't see user processes, which is wrong. Hardware threads refers to the "physical" threads your CPU can execute in parallel. So yes, software threads include userland processes.
– Panki
Dec 6 at 7:41
@StephenKitt: Sorry sir, it's not in english, I'm not english learner.
– ptr_user7813604
Dec 6 at 7:48
@StephenKitt: Sorry sir, it's not in english, I'm not english learner.
– ptr_user7813604
Dec 6 at 7:48
2
2
@Panki some userspace threading models are invisible to the kernel (they use an in-process scheduler).
– Stephen Kitt
Dec 6 at 7:48
@Panki some userspace threading models are invisible to the kernel (they use an in-process scheduler).
– Stephen Kitt
Dec 6 at 7:48
|
show 2 more comments
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
This is an area where terms tend to be overloaded — the same term is used with different meanings depending on the context. It’s not helped by the fact that the meaning commonly associated with various terms changes over time, so the age of the texts you’re reading is important.
There are a number of aspects to distinguish, or at least, two main ones.
- User v. kernel threads can refer either to the execution context, or the management context. “Kernel threads” in Linux usually refers to the former: a kernel thread is a thread run in the kernel, for the kernel’s purposes (in
ps
, you’ll see them as processes with names in square brackets, e.g.[kthreadd]
,[khugepaged]
...). - As mentioned in the SO answer, software v. hardware threads refers to the nature of the threads being discussed. In both cases, the concept of a thread is the idea of running multiple threads of execution in parallel. In the software sense, it’s a light-weight process; in the hardware sense, it’s a “light-weight” CPU (in Intel parlance, a hyperthread).
The “user threads” you’re referring to are typically known as green threads. They are software threads managed in userspace, with no kernel involvement. As with many concepts which are implemented in the kernel and in userspace, their use evolves over time as the perception of costs moves: in the past, and on other operating systems, threads weren’t well supported by the kernel, so they were implemented in user space; then kernels improved, and software started using kernel threads; then new environments considered kernel threads to be too expensive, and so it goes.
To answer your question, since user threads are software threads, the term “software threads” includes them.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f486309%2fdoes-software-threads-include-user-threads%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
This is an area where terms tend to be overloaded — the same term is used with different meanings depending on the context. It’s not helped by the fact that the meaning commonly associated with various terms changes over time, so the age of the texts you’re reading is important.
There are a number of aspects to distinguish, or at least, two main ones.
- User v. kernel threads can refer either to the execution context, or the management context. “Kernel threads” in Linux usually refers to the former: a kernel thread is a thread run in the kernel, for the kernel’s purposes (in
ps
, you’ll see them as processes with names in square brackets, e.g.[kthreadd]
,[khugepaged]
...). - As mentioned in the SO answer, software v. hardware threads refers to the nature of the threads being discussed. In both cases, the concept of a thread is the idea of running multiple threads of execution in parallel. In the software sense, it’s a light-weight process; in the hardware sense, it’s a “light-weight” CPU (in Intel parlance, a hyperthread).
The “user threads” you’re referring to are typically known as green threads. They are software threads managed in userspace, with no kernel involvement. As with many concepts which are implemented in the kernel and in userspace, their use evolves over time as the perception of costs moves: in the past, and on other operating systems, threads weren’t well supported by the kernel, so they were implemented in user space; then kernels improved, and software started using kernel threads; then new environments considered kernel threads to be too expensive, and so it goes.
To answer your question, since user threads are software threads, the term “software threads” includes them.
add a comment |
up vote
1
down vote
accepted
This is an area where terms tend to be overloaded — the same term is used with different meanings depending on the context. It’s not helped by the fact that the meaning commonly associated with various terms changes over time, so the age of the texts you’re reading is important.
There are a number of aspects to distinguish, or at least, two main ones.
- User v. kernel threads can refer either to the execution context, or the management context. “Kernel threads” in Linux usually refers to the former: a kernel thread is a thread run in the kernel, for the kernel’s purposes (in
ps
, you’ll see them as processes with names in square brackets, e.g.[kthreadd]
,[khugepaged]
...). - As mentioned in the SO answer, software v. hardware threads refers to the nature of the threads being discussed. In both cases, the concept of a thread is the idea of running multiple threads of execution in parallel. In the software sense, it’s a light-weight process; in the hardware sense, it’s a “light-weight” CPU (in Intel parlance, a hyperthread).
The “user threads” you’re referring to are typically known as green threads. They are software threads managed in userspace, with no kernel involvement. As with many concepts which are implemented in the kernel and in userspace, their use evolves over time as the perception of costs moves: in the past, and on other operating systems, threads weren’t well supported by the kernel, so they were implemented in user space; then kernels improved, and software started using kernel threads; then new environments considered kernel threads to be too expensive, and so it goes.
To answer your question, since user threads are software threads, the term “software threads” includes them.
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
This is an area where terms tend to be overloaded — the same term is used with different meanings depending on the context. It’s not helped by the fact that the meaning commonly associated with various terms changes over time, so the age of the texts you’re reading is important.
There are a number of aspects to distinguish, or at least, two main ones.
- User v. kernel threads can refer either to the execution context, or the management context. “Kernel threads” in Linux usually refers to the former: a kernel thread is a thread run in the kernel, for the kernel’s purposes (in
ps
, you’ll see them as processes with names in square brackets, e.g.[kthreadd]
,[khugepaged]
...). - As mentioned in the SO answer, software v. hardware threads refers to the nature of the threads being discussed. In both cases, the concept of a thread is the idea of running multiple threads of execution in parallel. In the software sense, it’s a light-weight process; in the hardware sense, it’s a “light-weight” CPU (in Intel parlance, a hyperthread).
The “user threads” you’re referring to are typically known as green threads. They are software threads managed in userspace, with no kernel involvement. As with many concepts which are implemented in the kernel and in userspace, their use evolves over time as the perception of costs moves: in the past, and on other operating systems, threads weren’t well supported by the kernel, so they were implemented in user space; then kernels improved, and software started using kernel threads; then new environments considered kernel threads to be too expensive, and so it goes.
To answer your question, since user threads are software threads, the term “software threads” includes them.
This is an area where terms tend to be overloaded — the same term is used with different meanings depending on the context. It’s not helped by the fact that the meaning commonly associated with various terms changes over time, so the age of the texts you’re reading is important.
There are a number of aspects to distinguish, or at least, two main ones.
- User v. kernel threads can refer either to the execution context, or the management context. “Kernel threads” in Linux usually refers to the former: a kernel thread is a thread run in the kernel, for the kernel’s purposes (in
ps
, you’ll see them as processes with names in square brackets, e.g.[kthreadd]
,[khugepaged]
...). - As mentioned in the SO answer, software v. hardware threads refers to the nature of the threads being discussed. In both cases, the concept of a thread is the idea of running multiple threads of execution in parallel. In the software sense, it’s a light-weight process; in the hardware sense, it’s a “light-weight” CPU (in Intel parlance, a hyperthread).
The “user threads” you’re referring to are typically known as green threads. They are software threads managed in userspace, with no kernel involvement. As with many concepts which are implemented in the kernel and in userspace, their use evolves over time as the perception of costs moves: in the past, and on other operating systems, threads weren’t well supported by the kernel, so they were implemented in user space; then kernels improved, and software started using kernel threads; then new environments considered kernel threads to be too expensive, and so it goes.
To answer your question, since user threads are software threads, the term “software threads” includes them.
answered Dec 6 at 9:55
Stephen Kitt
162k24360438
162k24360438
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f486309%2fdoes-software-threads-include-user-threads%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Why do you make the assumption that the OS does not know about 'user threads'? If I run
ps
, my OS shows me information about user threads/processes. I believe you are confusing threads with kernelspace/userspace.– Panki
Dec 6 at 7:33
@Panki: Why do you make the assumption that the OS does not know about 'user threads'? it's from a book I read, and it says in case of many to one model, OS only knows the "one" part, and don't about the "many" part.
– ptr_user7813604
Dec 6 at 7:35
@ptr_user7813604 You ask this question with the assumption that the OS can't see user processes, which is wrong. Hardware threads refers to the "physical" threads your CPU can execute in parallel. So yes, software threads include userland processes.
– Panki
Dec 6 at 7:41
@StephenKitt: Sorry sir, it's not in english, I'm not english learner.
– ptr_user7813604
Dec 6 at 7:48
2
@Panki some userspace threading models are invisible to the kernel (they use an in-process scheduler).
– Stephen Kitt
Dec 6 at 7:48