The book I am reading suggests that in a many-to-one multi-threading model, the threads are unable to run in parallel in a multi-core system. I am thinking this is not the case because if we have many-to-one means that multiple user threads are mapped to one kernel thread. However, there might be many kernel threads running in a multi-core system . Am I right ? The threads sharing the same kernel thread might not be able to run in parallel among themselves but when a thread is accessing on kernel thread, another user thread, not sharing the same kernel can be accessing its own kernel thread. So there will still be some user threads that running in parallel in the system.
$\begingroup$
$\endgroup$
6
-
$\begingroup$ What would be the difference between what you describe and a many-to-many threading model then? $\endgroup$– Derek Elkins left SEAug 15, 2019 at 3:07
-
$\begingroup$ So does a many-to-one mean that all user threads are assigned to just one single kernel thread ? $\endgroup$– jungleManAug 15, 2019 at 3:13
-
$\begingroup$ Yes, at least for the relevant process. $\endgroup$– Derek Elkins left SEAug 15, 2019 at 3:16
-
$\begingroup$ @DerekElkins, Ok I guess I should think of it in the context of a process rather than in the whole systems. So meaning in a multi-core system, multiple threads can be running in parallel if they are in different processes even for a many-to-one model $\endgroup$– jungleManAug 15, 2019 at 3:19
-
1$\begingroup$ It depends on the level the threading model is being used to describe. Often discussion of threading models comes up with respect to programming language runtimes like the Java Virtual Machine or the GHC runtime. You may describe one of these runtimes as M:1 or 1:1 or M:N, but the whole application is running all in one process. So if the application is using an M:1 model, and different application also using an M:1 model in a different process can be running truly simultaneously in a multi-core system. $\endgroup$– Derek Elkins left SEAug 15, 2019 at 3:33
|
Show 1 more comment