kernal thread and user thread - Linux
This is a discussion on kernal thread and user thread - Linux ; I have read the 7th edition. I know there
are three ways to map kernal thread and user thread, like one to one,
one to many, many to one.
I really want to know is there always one kernal thread ...
-
kernal thread and user thread
I have read the 7th edition. I know there
are three ways to map kernal thread and user thread, like one to one,
one to many, many to one.
I really want to know is there always one kernal thread to map one
user thread, In other words, if user create a thread just like print
"hello world" to command line, is there a kernal thread to map this
thread?
-
Re: kernal thread and user thread
netwalker128@gmail.com writes:
> I have read the 7th edition. I know there
> are three ways to map kernal thread and user thread, like one to one,
> one to many, many to one.
Usually, these would be called 1:1 (every thread is visible to the
kernel), 1:m (the kernel know nothing about threads) and m:n (n 'user
threads' are mapped to m 'entities' the kernel scheduler deals with,
m < n).
> I really want to know is there always one kernal thread to map one
> user thread, In other words, if user create a thread just like print
> "hello world" to command line, is there a kernal thread to map this
> thread?
For the pthreads-implementation being part of glibc, the answer would
be yes.
-
Re: kernal thread and user thread
On Oct 20, 6:02 am, netwalker...@gmail.com wrote:
> I really want to know is there always one kernal thread to map one
> user thread, In other words, if user create a thread just like print
> "hello world" to command line, is there a kernal thread to map this
> thread?
While a thread is actually running, there almost has to be one and
only one kernel thread that it maps to.
By the way, please note carefully that the phrase "kernel thread" here
means a thread that is scheduled by the kernel. This is not the usual
meaning of "kernel thread" which is "a thread that executes in kernel
space".
DS