DragonFly users List (threaded) for 2007-01
DragonFly BSD
DragonFly users List (threaded) for 2007-01
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: Request for swapcontext and getcontext to be ported to our libc


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Fri, 12 Jan 2007 19:09:37 -0800 (PST)

:However, I recall it being mentioned that the proliferation of syscalls is
:unneccessary, so a libc implementation would keep the kernel lean.  The
:reason we need curthread is to get access to the frame construct, which is
:neccessary to save the context.
:
:Regards,
:--
:Matt Emmerton

    Nah.  The frame is just made up of entirely user-accessible registers.
    The only thing that is kernel-only is the signal mask (and one can make
    a system call to get it).  The FP state can be controlled in userland 
    too.

    The really interesting thing about it is that if you do it in userland
    you don't have to save or restore the call-used registers.

    I think the FreeBSD folks did these as system calls because they believe
    the context switching routines may have to do other kernel-only things
    in the future.  That isn't a bad argument.

    On the otherhand, if one is talking about operating in virtualized
    environments (any sort of virtualization), having to do a system call
    at all is very, very expensive.

					-Matt
					Matthew Dillon 
					<dillon@backplane.com>



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]