kthread_create1, kthread_exit, kthread_create - kernel threads
#include <sys/kthread.h>
void
kthread_create(void (*func)(void *), void *arg);
void
kthread_exit(int ecode);
int
kthread_create1(void (*func)(void *), void *arg, struct proc **newpp,
const char *fmt, ...);
Kernel threads are light-weight processes which execute entirely within
the kernel. Any process can request the creation of a new kernel thread.
Kernel threads are not swapped out during memory congestion. The VM
space and limits are shared with proc0 (usually swapper).
kthread_create1(func, arg, newpp, fmt, ...)
Fork a kernel thread. newpp is a pointer the the new proc
structure for the kernel thread. The function func is called
with arguments arg to commence execution. fmt is a string containing
format information used to display the kernel thread
name.
kthread_create(void (*func)(void), void *arg)
Register function func to defer creation of the kernel thread.
Deferral of kernel thread creation is required during system
startup when kernel thread resources are not available.
kthread_exit(int ecode)
Exit from a kernel thread.
Upon successful completion, kthread_create1() returns 0. Otherwise, the
following error values are returned:
[EAGAIN] The limit on the total number of system processes would be
exceeded.
[EAGAIN] The limit RLIMIT_NPROC on the total number of processes under
execution by this user id would be exceeded.
This section describes places within the NetBSD source tree where actual
code implementing or utilising the kthread framework can be found. All
pathnames are relative to /usr/src.
The kthread framework itself is implemented within the file
sys/kern/kern_kthread.c. Data structures and function prototypes for the
framework are located in sys/sys/kthread.h.
driver(9), fork1(9)
The kthread framework appeared in NetBSD 1.4.
BSD July 9, 2000 BSD
[ Back ] |