[Top][All Lists]

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

Re: extant send rights

From: Thomas Bushnell, BSG
Subject: Re: extant send rights
Date: 07 May 2001 18:31:49 -0700
User-agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.7

Marcus Brinkmann <Marcus.Brinkmann@ruhr-uni-bochum.de> writes:

> why is mach_port_get_receive_status just returning a boolean if send right
> exists (the mach code has the equivalent of "srights = ip_srights > 0"), but
> the exact number of extant send once rights, while there is a special debug
> call mach_port_get_srights to get the exact number?

There are two ways send rights might get created, and these calls must
synchronize against those in order to provide useful answers about the
total number of rights.  Those two ways are MAKE_SEND and COPY_SEND.

It is assumed the holder of the receive right can synchronize against
MAKE_SEND, but there's no way he can deal with COPY_SEND.

What that means is that if you do mach_port_get_srights, and you get a
number (say, "6"), you can't do anything useful with that number even
a single instruction after your RPC returns, because it might now be
seven, or eight, or thirty-five.

But, if there are no rights, then you can be guaranteed that no
COPY_SEND will happen, and so there will be no new rights created
without your knowing.  So getting False back from
mach_port_get_receive_status.srights is a stable value.  Getting True
back means "there might be an extant send right", it doesn't mean
there are certainly some.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]