I'm afraid I've found the cause of strange statistics
look at this code in sqllistener.C :
shmdata *ptr=(shmdata *)staticlistener->idmemory->getPointer();
ptr->statistics.forked_listeners--;
If 2 processes simultaniously get access to shared memory and, for
example, in this moment forked_listeners = 10, then they both decrease
this value to 9 and put back to shared memory. As result would be 9
instead of 8.
Solution ids obvious: semaphores should be used to access shared memory.
For example:
shmdata *ptr=(shmdata *)staticlistener->idmemory->getPointer();
sem_t *mutex=staticlistener->idmemory->getSemaphore();
sem_wait(mutex);
ptr->statistics.forked_listeners--;
sem_post(mutex);
--
Renat Sabitov e-mail: sr...@st...
Stack Soft jid: sr...@ja...
|