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
|
|