multithreading - How do user level threads (ULTs) and kernel level threads (KLTs) differ with regards to concurrent execution? -
here's understand; please correct/add it:
in pure ults, multithreaded process thread scheduling. so, kernel not notice difference , considers single-thread process. if 1 thread makes blocking scheme call, entire process blocked. even on multicore processor, 1 thread of process running @ time, unless process blocked. i'm not sure how ults much help though.
in pure klts, if thread blocked, kernel schedules (ready) thread of same process. (in case of pure klts, i'm assuming kernel creates threads of process.)
also, using combination of ults , klts, how ults mapped klts?
your analysis correct. os kernel has no knowledge of user-level threads. perspective, process opaque black box makes scheme calls. consequently, if programme has 100,000 user-level threads 1 kernel thread, process can 1 run user-level thread @ time because there 1 kernel-level thread associated it. on other hand, if process has multiple kernel-level threads, can execute multiple commands in parallel if there multicore machine.
a mutual compromise between these have programme request fixed number of kernel-level threads, have own thread scheduler divvy user-level threads onto these kernel-level threads appropriate. way, multiple ults can execute in parallel, , programme can have fine-grained command on how threads execute.
as how mapping works - there bunch of different schemes. imagine user programme uses 1 of multiple different scheduling systems. in fact, if substitution:
kernel thread <---> processor core
user thread <---> kernel thread
then scheme os utilize map kernel threads onto cores used map user-level threads onto kernel-level threads.
hope helps!
multithreading concurrency parallel-processing operating-system
No comments:
Post a Comment