How to use kernel_thread()?

Andreas Bombe (andreas.bombe@munich.netsurf.de)
Tue, 18 May 1999 20:05:01 +0200


I don't completely understand how to start kernel threads using
kernel_thread(). Especially the flags are a problem. Yes, I do read
the sources a lot, but I don't understand task management completely
yet.

I need a thread that will run completely in kernel context and will not
exec() or whatever. In the USB drivers there are a few instances of
kernel_thread, but they CLONE_* a few things and then disable them
again in the thread (like MM, files). Elsewhere in the kernel threads
are spawned with zero flags.

So
- What flags should I use?
- What initialization should I do at the beginning of the thread?
- How do I cleanly exit the thread?
- I guess I can't fork a thread in interrupt context (in the case I
would not want a permanently running thread), can I?

-- 
    Andreas E. Bombe <andreas.bombe@munich.netsurf.de>
    http://home.pages.de/~andreas.bombe/
PGP 0x886663c9  30 EC 09 73 84 7B 55 83  C4 7A 91 D9 9D C5 4B B0
GPG 0x04880A44 72E5 7031 4414 2EB6 F6B4  4CBD 1181 7032 0488 0A44

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/