|
Yes, its completely possible.
You'll want to look into IPC. I wrote something similar for a proxy server and web server using SysV Shared Memory and Semaphores. There's a POSIX version, but the man pages for it say it doesn't work for separate processes, only within the same process in just about every Operating System. However, every OS that I've run the POSIX versions on work between processes, despite the man page saying otherwise.
Though, you can do this in a couple ways.
You can skip IPC completely and use sockets to communicate between processes. This will work well and allow you to have the processes network transparently in the future. The performance won't be as good as with Shared Memory, but it will work fast enough for what you're after (Shared Memory starts to spank using sockets as transfers get larger). If you're simply sending messages, the best way is to use sockets (you may actually get better performance this way, even).
If you decide you want to delve into IPC, "man ipc". I, or someone else, can give you more help if you get stuck (for sockets as well, of course), its really easy once you understand what you have to do (you'll need two shared semaphores and some amount of shared memory to do what you want). IPC has a few ways that things can be done, as well.
I'd strongly suggest using sockets, in this case. Whatever you decide, just post again and we can help you out some more.
__________________
If you always think like an expert, you'll always be a beginner. | "A handful of knowledgeable people is more effective than an army of fools" -Writing Secure Code, 2nd Ed.
|