Operating system concepts 9th edition (dinosaur book) User thread, kernel thread question.

Asked 2 years ago, Updated 2 years ago, 157 views

I have a question because I don't understand the user thread well.

'Thread management is done by the thread library in user space, so it is efficient'

'because only one thread can access the kernel at a time, multiple threads are unable to run in parallel on multicore systems'

It's written like this. Wouldn't there be no performance improvements if it couldn't run on more than two cores? What is the meaning of 'effective' in the first sentence?

2.'The one-to-one model (Figure 4.6) maps each user thread to a kernel thread'

'The many-to-one model (Figure 4.5) maps many user-level threads to one kernel thread'

What is the meaning of the map used in these two sentences? Copy contents of user thread to kernel thread Is this what it means?

thread operating-system

2022-09-22 19:54

1 Answers

In the first question, this is the difference between concurrency and parallelism.

Concurrency is a concept that existed even before multi-core came out. It's a single word that processes multiple tasks at the same time, splitting one core into time and running multiple tasks alternately. It's a matter of course, but the speed of the work doesn't change, but it looks fast.

On the other hand, parallelism is closely related to multicore. It's distributing multiple tasks across multiple cores. Therefore, unlike concurrents that seem to run simultaneously, they process tasks at the same time.

With the man-to-one model, concurrency can be achieved, but parallelism is not possible. As you know, there's only one thing you can do at a time.

However, the one-to-one model enables parallelism as well as concurrence. When you use multicore, the jobs actually run at the same time.

In the second question, map is a thread in user mode asking kernel thread to run it. The reason why I do this is that kernel threads are quite heavy, so I can't make as many as user threads. The kernel thread has many attributes like a rare setting and priority, and that makes the movement complicated. This is because instead of creating a new kernel thread, you can write a playing kernel thread.


2022-09-22 19:54

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.