Results 1 to 2 of 2
Hi I have some newbie questions about kernel threads in kernel 2.6 created with "kernel_thread" function. 1. Let's say user program "hello_world" called some system function "do_it". Then kernel function ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 01-03-2008 #1
- Join Date
- Jan 2008
I have some newbie questions about kernel threads in kernel 2.6 created with "kernel_thread" function.
1. Let's say user program "hello_world" called some system function "do_it". Then kernel function "sys_do_it" creates thread using "kernel_thread". Is the new thread child of the process "hello_world"?
2. Does kernel threads have same semantics as pthreads?
3. I read that kernel threads have initially blocked signals. I know that i have to unblock signals in kernel thread, but how do i receive them?
4. In my example if kernel thread is child of "hello_world" then what happens when i unblock signal SIGTERM (in what context signal handler function will be executed and who will receive it (process "hello_world" or my kernel thread))? Can kernel thread steal signal before process "hello_world" handle it?
5. How do i wait for kernel thread to finish? Can kernel thread's be zombies?
6. How do i gracefully finish execution of kernel thread (what do i have to call in kernel thread function)?
Thank very much
- 04-04-2008 #2
- Join Date
- Mar 2008
terminating kernel thread
I have searched over the net but could not find a good explanation of how to terminate a kernel thread.
For an academic project, I have created several kernel thread during system boot, and then try to kill them.
I use do_exit() in thread function to let thread to terminate itself bu I got this error
"unable to handle kernel paging request at virtual address 6f635f6f
I used kill_proc(...) but got the same kind of error.
what is the true way to terminate a kernel thread?