启发主要来自于http://blog.csdn.net/newnewman80/article/details/7050090,基本是根据自己的习惯重组的。
相关函数:
kthread_create():创建内核线程
struct task_struct *kthread_create(int (*threadfn)(void *data), void *data, const char namefmt[], ...);
kernel thread可以用kernel_thread创建,但是在执行函数里面必须用daemonize释放资源并挂到init下,还需要用completion等待这一过程的完成。为了简化操作,定义了kthread_create。线程创建后,不会马上运行,而是需要将kthread_create() 返回的task_struct指......
阅读全文