On Thu, Sep 16, 2010 at 01:17:27PM -0500, Jason wrote:
> On Thu, Sep 16, 2010 at 12:46 PM, Louis Munro <l...@louismunro.com> wrote:
> > I also understand that when a set is full a request for an aditional 
> > semaphore will be allocated form another set if there is one available.
> > Again, is that right?
> 
> Not sure, but seems likely.  I suspect it's probably sequential
> through each set.

No.  The manpage [see semget(2)] states that the number of semaphores in
the set is specified at creation time.  If you want to change the number
of semaphores in the set, you've got to delete the set and create a new
one.

> > Last, if that is the case, why do we have sets to begin with?  There
> > must be some use to the sets or else I don't see why they would
> > still be around but I can't figure out a case where a large number
> > of small sets would be better than a small number of large sets.
> > Does anyone know?

Lookup by ID is going to be faster than looking up one ID and iterating
through a long list of sempahores.  Since the operations are applied
atomically to all semaphores in the set, you'd want other sets for
disjoint operations.  The SysV IPC is also part of UNIX standards, so we
can't just change it at will, otherwise applications that depend upon
the interface will break.

-j
_______________________________________________
perf-discuss mailing list
perf-discuss@opensolaris.org

Reply via email to