unused shared objects in /dev/shm/ngpt

"Dr. Uwe Girlich" <[email protected]>
Newsgroups gmane.linux.ngpt.devel
Message-ID <[email protected]>
Hello list!

I'm playing a bit with shared objects and find the whole concept a bit fragile:
I create a lot of shared mutexes and shared conditional variables in some
shared memory. Then all programs, using these shared objects (and the shared
memory holding them) will be killed and the shared memory will disappear
(either via ipcrm or because the shared memory id was removed already and so
the last detach (in the exit() system call) will destroy the shared memory
segment). Now the problem: NGPT uses /dev/shm/ngpt as an extra space for shared
objects, and now we have no pointer to the just unused shared objects any
more. Sooner or later we get ENOMEM as error of pthread_mutext_init(), because
the file is full of no longer used shared objects.
I can only be sure, that a normal program end will call pthread_cond_destroy()
and pthread_mutex_destroy() but a kill -9 can (and will) come fairly often
during normal production work.
Do I need a monitor process to constantly read /dev/shm/ngpt and looking for
mx_owner_pid values, which no longer exist (and a similar concept for cond.
variables)?

Bye, Uwe

-- 
Dr. Uwe Girlich              email: [email protected]
Philosys Software GmbH       www: www.philosys.de
Edisonstrasse 6              phone: +49 89 321407-44
D-85716 Unterschleissheim    fax: +49 89 321407-12
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.