#ifdef _KERNEL in lwkt_thread.c

Matthew Dillon dillon at apollo.backplane.com
Sun May 18 09:54:16 PDT 2008


:Hello,
:
:kern/lwkt_thread.c can apparently be compiled both as kernel and user
:land code (cf #ifdef _KERNEL in file).  What's the purpose of this?
:Was it just initially developed user-side then ported into the kernel
:or is there something else?
:
:Thanks,
:Nicolas

    Originally I tested the core mechanics in userland, and had an idea
    to use it for the userland thread scheduler in a NxM configuration
    (N kernel threads x M userland threads per kernel thread), using
    async system calls.

    That never worked out... it was just too complex and implementing async
    system calls turned out to be basically impossible without rewriting
    the entire kernel.  So the module is no longer intended to be compiled
    for userland.

					-Matt
					Matthew Dillon 
					<dillon at backplane.com>





More information about the Kernel mailing list