Why use `thread' as an argument of Syscalls?

Garrett Wollman wollman at khavrinen.csail.mit.edu
Mon Jun 5 08:43:07 PDT 2006


Robert Watson writes:

>Certainly consistency.  Most system calls do actually use the argument at some 
>point -- be it to look up a file descriptor, access control, or the like, and 
>the calling context has it for free and in-hand anyway.

I believe it was the intention of the 4.4BSD developers to completely
eliminate "curproc" (as they had already successfully eliminated "u"),
on the theory that with a modern (RISC) processor architecture,
passing the current process as a parameter wouldn't cost anything
(since it would stay in a register for the life of the system call)
whereas making a context-switched "curproc" would be expensive.

-GAWollman



More information about the freebsd-arch mailing list