Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

What is the purpose of proc::p_endpoint

30 views
Skip to first unread message

Matej Kosik

unread,
Jun 28, 2006, 8:38:19 AM6/28/06
to
Hello,

I am confused about the `p_endpoint' element of the `proc' structure
(defined in kernel/proc.h).

What is its purpose? Is it meant to avoid choosing certain magic (ANY,
ANY, SELF) process numbers? That might be indeed a problem. But I cannot
figure out how "endpoints" could be helpful in that case.

Cheers
--
Matej Kosik

Ben Gras

unread,
Jun 28, 2006, 10:11:42 AM6/28/06
to
All,

It is a number that identifies that process for ipc (for send(),
receive(), sendrec() and notify()) and kernel calls (sys_fork(), signal
functions, and many others) - previously slot numbers.

When such an ipc number is given to refer to a process, a simple
function obtains the slot number from that number. If the slot number
is in range and the slot contains a living process, the given number is
checked against the number in that slot. If it checks out, the endpoint
number is valid. Otherwise, it's not.

Every time a new process occupies a process slot number, the endpoint
generation number is incremented, giving rise to a new endpoint
number. So the endpoint number of the process previously occupying
that slot won't work any more.

That is its purpose. Slot numbers are always valid, even if the process
that was the intended reference is dead. In the old days this wasn't
a problem, as relevant processes (system servers and drivers) didn't
really disappear or appear dynamically.

=Ben


0 new messages