This is a conceptual question.
According to this post, pthread is actually implemented using the clone () system call. Thus, we can conclude that there is a kernel thread (or light process) that supports pthread in user space. The kernel is aware of pthread and can schedule it as a process.
Regarding kthread, according to Robert Love , kthreads are also created using the clone () system call:
clone(CLONE_VM| CLONE_FS | CLONE_FILES | CLONE_SIGHAND, 0)
Thus, pthread and kthread use the clone () call. My first question is:
- Is there a difference between the two types of threads?
To answer my question, I read:
A significant difference between kernel threads and normal processes is that kernel threads do not have an address space (in fact, their mm pointer is NULL).
Is that one difference? I mean, the thread created by pthread_create () shares the address space with the regular process. In contrast, kthread does not have its own address space. It's right?
What else?
source
share