阅读:1609回复:5
如何创建linux内核线程?
我查阅了《linux驱动》这本经典,但是一无所获!
|
|
沙发#
发布于:2003-04-23 17:13
drivers/net/8139too.c
1first create a thread \" tp->thr_pid = kernel_thread (rtl8139_thread, dev, CLONE_FS | CLONE_FILES); \" 2at the begin of the thread change it. for example release user process mm, get init\'s fs . be the son of init....u can dig into source for my detail. \" daemonize (); reparent_to_init(); spin_lock_irq(¤t->sigmask_lock); sigemptyset(¤t->blocked); recalc_sigpending(current); spin_unlock_irq(¤t->sigmask_lock); strncpy (current->comm, dev->name, sizeof(current->comm) - 1); current->comm[sizeof(current->comm) - 1] = \'\\0\'; \" |
|
板凳#
发布于:2003-04-23 17:30
老大从哪找到的资料?
|
|
地板#
发布于:2003-04-23 17:35
原来是源代码
|
|
地下室#
发布于:2003-04-23 18:14
The Design of an In-Kernel Server
by Alessandro Rubini [url]http://www.linux-mag.com/2000-12/gear_01.html [/url] |
|
5楼#
发布于:2003-04-25 15:26
kenel level thread是个很霸道的东东,除非你自己释放cpu的使用权,他会一直占用cpu, 用的时候注意了。
|
|