OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Re: CVS commit: src/sys

From: Thor Lancelot Simon (tlsrek.tjls.com)
Date: Sun Jun 24 2007 - 21:19:44 CDT


On Sun, Jun 24, 2007 at 10:13:16PM -0400, Christos Zoulas wrote:
>
> It would be nice if someone implemented a commpage for NetBSD and stuffed all
> this info there.

This isn't what would go in the traditional "commpage" which is common
between *all* user processes and the kernel, because (for example) the result
of getpid() is specific to *each process*. The result of getpid() belongs
in a local variable in each process, I believe, reset at fork() time in
each child.

We could implement two "commpages" per process: one shared between the kernel
and *all* processes (for gettimeofday(), cpu-optimized memcpy() etc, and that
sort of thing) and another shared between the kernel and *each* process (for
getpid(), getppid(), and so forth) but why pay the penalty of accessing a
shared page if you don't have to?

Perhaps this would be a reasonably elegant way to handle getppid() without
any kind of asynchronous notification to the process, though. But for
getpid() a local variable will do -- unless you see some reason why it
won't?

--
Thor Lancelot Simon tlsrek.tjls.com
  "All of my opinions are consistent, but I cannot present them all
   at once." -Jean-Jacques Rousseau, On The Social Contract