由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - why do we need to map user threads to kernel threads?
相关主题
a dummy OS question真正的multi-threading是5个thread要5个cpu?那apache是真正的m
multithread app的design要注意哪些问题?多线程 编程,process 和 thread 的一些问题。
thread, semaphore, 问题。C10M除了socket以外,还牵涉其他方面的技巧
One OS scheduling question (转载)关于thread的stack
请教一个linux下面的多线程semaphore的问题。关于process and threads的问题
感觉c挺有一丝的嘛Concurrency of assignment statement in C
Node.js 是有 multiple-threading 支持的?在User space下怎么拿到CPU的当前频率值
请教牛人:自学内核编程怎么开始呢[合集] question about the kernel scheduler (转载)
相关话题的讨论汇总
话题: threads话题: kernel话题: user话题: thread话题: mapping
进入Programming版参与讨论
1 (共1页)
S**Y
发帖数: 136
1
I am reading threads, and don't understand the thread-mapping model
why do we need to map user level threads to kernel threads anyway?
who can say say? thanks!
X****r
发帖数: 3557
2
I'm not sure I understand your question -- kernel threads are what the
kernel sees, and user threads are what the applications see, so there
must be a mapping somehow, right? After all, if a piece of code is
executing, both the application and the kernel should agree on this
fact.

【在 S**Y 的大作中提到】
: I am reading threads, and don't understand the thread-mapping model
: why do we need to map user level threads to kernel threads anyway?
: who can say say? thanks!

S**Y
发帖数: 136
3
thanks, thinking pig...
yes. u understood me.
i still dont understand "so there
why can't the CPU directly schedule the user threads instead of mapping them
to a kernel thread? why do we need this mapping?
Thanks.
X****r
发帖数: 3557
4
It is the kernel, not the CPU, does the scheduling, and the threads
being scheduled by the kernel are called, by definition, kernel threads.
Sure, we can make that every user thread corresponding one kernel thread
and let the kernel to handle scheduling, context switch, etc, completely,
which is called 1:1 mapping.

them

【在 S**Y 的大作中提到】
: thanks, thinking pig...
: yes. u understood me.
: i still dont understand "so there
: why can't the CPU directly schedule the user threads instead of mapping them
: to a kernel thread? why do we need this mapping?
: Thanks.

S**Y
发帖数: 136
5
thanks...
does it mean that, no matter what, a user level thread has to be attached(bo
und) to a kernel thread to be scheduled? therefore, there are m:1, 1:1, m:n
models?

【在 X****r 的大作中提到】
: It is the kernel, not the CPU, does the scheduling, and the threads
: being scheduled by the kernel are called, by definition, kernel threads.
: Sure, we can make that every user thread corresponding one kernel thread
: and let the kernel to handle scheduling, context switch, etc, completely,
: which is called 1:1 mapping.
:
: them

X****r
发帖数: 3557
6
Yes.

attached(bo
m:n

【在 S**Y 的大作中提到】
: thanks...
: does it mean that, no matter what, a user level thread has to be attached(bo
: und) to a kernel thread to be scheduled? therefore, there are m:1, 1:1, m:n
: models?

S**Y
发帖数: 136
7
thanks..

【在 X****r 的大作中提到】
: Yes.
:
: attached(bo
: m:n

1 (共1页)
进入Programming版参与讨论
相关主题
[合集] question about the kernel scheduler (转载)请教一个linux下面的多线程semaphore的问题。
如何强制thread和cpu绑定?感觉c挺有一丝的嘛
p-thread profilingNode.js 是有 multiple-threading 支持的?
问个白痴问题请教牛人:自学内核编程怎么开始呢
a dummy OS question真正的multi-threading是5个thread要5个cpu?那apache是真正的m
multithread app的design要注意哪些问题?多线程 编程,process 和 thread 的一些问题。
thread, semaphore, 问题。C10M除了socket以外,还牵涉其他方面的技巧
One OS scheduling question (转载)关于thread的stack
相关话题的讨论汇总
话题: threads话题: kernel话题: user话题: thread话题: mapping