I’m having a problem with semaphores. I’m not so much looking for as a
solution but rather an explanation as to why, if possible.
In the kernel, Proc32 -e 300 (300 semaphores)
In the application code, loops create 243 semaphores, at startup, in
shared_memory.
There are multiple versions of the application code (for different
customers), and each has a different size to shared_memory.
There is no gracefull shutdown. No calls to sem_destory. Application
shutdown is by script which just slays all the processes.
Now the problem:
Start and stop the application code for one customer, then start the
application for another customer, and I get an error creating the
semaphores. With the old 243 not destroyed, and another 243 to create,
I guess I run over my limit of 300.
But, successive start stop starts of the same application code, doesn’t
present the problem.
I have to reboot to change between applications for two different
customers, or even the same customers code, but in a test version where
the shared_memory size has changed.
Why do successive restarts have no problems? You’d expect, if I didn’t
destroy the semaphores on shutdown, that I’d have problems creating more
(having crossed my 300 limit on second startup) no matter which
customers application was starting.
I guess that as long as the semaphores are in the same place in memory,
it knows they are the same ones when you creat them the second time, but
I don’t know.
Scott