I don't know anything that already exists, but you should be able to create something using a combination:
- Memory mapped files
- Events
- mutex
- Semaphore
This can be constructed in such a way that no "master process" is required, since all of them can be created as named objects, which are then managed by the OS and are not destroyed until the last client uses them. The basic idea is that the first startup process creates the objects you need, and then all other processes connect to them. If the first process terminates, the objects remain as long as at least one other process supports a handle for them.
A memory mapping file is used to exchange memory between processes. Mutex provides synchronization to prevent concurrent updates. If you want to allow multiple readers or one writer, you can build something like a read / write lock using a couple of mutexes and a semaphore (see Is there a global read / write lock? ). And events are used to notify everyone when new posts are posted.
I waved some important technical details. For example, knowing when to reset the event is pretty tough. Instead, you can get a poll of each application for updates.
But switching to this route will provide a non-contact way of exchanging information. This does not require the server-side process to always work.
For implementation, I would suggest implementing it in C ++ and letting C # programs invoke it through P / Invoke. Or perhaps in C #, and let C ++ applications call this through COM interaction. This assumes, of course, that your C ++ applications are native, not C ++ / CLI.
Jim mischel
source share