*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->NetBSD man pages -> kthread_create (9)              
Title
Content
Arch
Section
 

KTHREAD(9)

Contents


NAME    [Toc]    [Back]

     kthread_create1, kthread_exit, kthread_create - kernel threads

SYNOPSIS    [Toc]    [Back]

     #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, ...);

DESCRIPTION    [Toc]    [Back]

     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).

FUNCTIONS    [Toc]    [Back]

     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.

RETURN VALUES    [Toc]    [Back]

     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.

CODE REFERENCES    [Toc]    [Back]

     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.

SEE ALSO    [Toc]    [Back]

      
      
     driver(9), fork1(9)

HISTORY    [Toc]    [Back]

     The kthread framework appeared in NetBSD 1.4.

BSD                              July 9, 2000                              BSD
[ Back ]
 Similar pages
Name OS Title
ithread_priority FreeBSD kernel interrupt threads
ithread FreeBSD kernel interrupt threads
ithread_create FreeBSD kernel interrupt threads
ithread_destroy FreeBSD kernel interrupt threads
ithread_schedule FreeBSD kernel interrupt threads
ithread_remove_handler FreeBSD kernel interrupt threads
ithread_add_handler FreeBSD kernel interrupt threads
kse_release FreeBSD kernel support for user threads
kse_exit FreeBSD kernel support for user threads
kse_create FreeBSD kernel support for user threads
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service