multithreading - In single-threaded applications, is that one and only thread a kernel thread? -
from wikipedia says:
a kernel thread "lightest" unit of kernel scheduling. at least 1 kernel thread exists within each process.
i've learned process container houses memory space, file handles, device handles, system resources, etc... , thread 1 gets scheduled kernel.
so in single-threaded applications, 1 thread(main thread believe) kernel thread?
i assume talking article: http://en.wikipedia.org/wiki/kernel_thread
according article, in single threaded application, since have 1 thread definition, has kernel thread, otherwise not scheduled , not run.
if had more 1 thread in application, depend on how user mode multi threading implemented (kernel threads, fibers, etc ...).
it's important note kernel thread running in user mode, when executing application code (unless make system call). attempt execute protected instruction when running in user mode cause fault lead process being terminated.
so kernel thread here not confused supervisor/privileged mode , kernel code.
you can execute kernel code, have go through system call gate first.
Comments
Post a Comment