Re: No space left to create named semaphores
Re: No space left to create named semaphores
- Subject: Re: No space left to create named semaphores
- From: "John J. Francini" <email@hidden>
- Date: Thu, 23 Jun 2005 00:24:45 -0400
Title: Re: No space left to create named
semaphores
Semaphores are persistent entities, independent of an individual
process's lifetime. Their raison d'etre is to allow multiple
processes to cooperate with each other when accessing shared memory
segments.
Many multi-process database systems use semaphores -- lots of
them -- for this purpose, since they'll often cache gigabytes of table
data in memory, with lots of data structures protected by
semaphores.
When a semaphore is closed, the descriptor -- a pointer to the
semaphore, along with housekeeping data -- is deallocated from the
process' memory. But the semaphore itself persists in kernel
space, taking one of the semaphore slots controlled by the sem*
sysctl(8) settings.
The last process using the semaphore is supposed to unlink it.
Otherwise the kernel space taken up by the semaphore will remain
allocated until the system is rebooted or the (unsupplied by Apple)
ipcrm(8) utility is used to delete the semaphore.
Closing a semaphore but not unlinking it is analogous to closing
a file and not unlinking it -- both persist in their respective
places. Closed semaphores remain in kernel memory, and closed
files remain in their directories on the file system.
Hope this makes it clearer,
John Francini
I discovered that I had made a mistake
with my build that was logging the closing of named of semaphores.
Once I got it working correctly I saw evidence that many semaphores
were in fact being closed. This means that we might not be
leaking semaphores, although that is far from conclusive.
Another thing that I noticed is that semaphores are being closed and
they are not being unlinked. The documentation for closing a
semaphore says "resources associated with the named
semaphore referenced by/ /sem are deallocated and the descriptor is
invalidated." The documentation for unlink says "The
named semaphore named name is removed."
I'm not really sure what the differences are between deallocating and
invalidating a descriptor versus removing the semaphore. How
important would it be to unlink a semaphore as well as closing it?
Paul Ripke wrote:
On Wednesday, Jun 22, 2005, at 17:14 Australia/Sydney, Jonas Maebe
wrote:
man ipcs (didn't exist yet on 10.3
afaik)
Although there are a few versions floating out on the 'net for
10.3 and below...
Including:
http://stix.homeunix.net/wiki/ipcs/ipcrm_for_Darwin
Cheers,
--
stix
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list
(email@hidden)
Help/Unsubscribe/Update your Subscription:
>
This email sent to email@hidden
--
----
John Francini <mailto:email@hidden>
+---------------------------------------------------------------------------+
| "I have come to the conclusion that one useless man is called a
disgrace; |
| that two are called a law firm; and that three or more become
a Congress.|
| And by God I have had _this_
Congress!" |
|
-- John Adams |
+---------------------------------------------------------------------------+
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden