[Serdev] SER-wide IPC/RPC, how?
Maxim Sobolev
sobomax at portaone.com
Fri May 28 11:12:02 UTC 2004
Folks,
We are currently investigating possibility to enhance database support
in usrloc module to make it more robust. The idea is that when the
database goes down for some reason, ser should be able to detect it and
switch automatically to memory-only mode. When in this mode it should
from time to time try to re-connect to the db. Once the connection is
restored it syncs in-memory contacts table with that in the db and
switches back to the previous mode.
Unfortunately current architecture makes almost impossible to do it
correctly since both timer thread and listening threads perform database
operations. My plan is to restructure the code somehow, so that only
timer thread is allowed to perform db operations, which would require
some way in which listening threads can "wake up" timer thread and ask
it to insert or update specific contact. This brings up question in the
subject: is there any existing way for the listening thread to perform
remote procedure call or queue task for the timer thread and wake it up?
I guess that it can be done using shared memory and semaphores, just
wonder if there any existing APIs that can be re-used or similar code,
so that I will not be re-inventing the wheel.
Any ideas or suggestions are highly appreciated.
Regards,
Maxim
More information about the Serdev
mailing list