|
-
April 13th, 2007, 05:24 PM
#1
IPC Suggestions
I need help determining what methods of interprocess communication would be best to use for my situation.
I am adding on to a large existing application, and I have determined that I need to create a small external process to do some slave operations. The main application will start the external process when it's needed, and close/terminate it when it's no longer needed.
The simplest and almost ideal method of communicating between these two applications would be to use Windows messages. The problem with that though is that the external process will need to send real-time streaming data back to the main application. I don't want to be flooding the main application's message pump with hundreds of messages a second as data comes through the external process, so I need another way of handling this volume of data.
Windows sockets would be a nice solution, except I cannot use this because we believe we have determined that using local asynchronous sockets in combination with certain firewalls can cause serious crashes.
Currently my best option seems to be to use named pipes. The problem I have with this though is that it's not so easy to use pipes asynchronously (at least so far as I've been able to determine). The main application that's going to be receiving this data is primarily single threaded, and that's not going to change. The user interface and data processing happen in the same thread, so I can't use any blocking calls. Overlapped I/O doesn't really work either because I can't be sitting in a loop continually checking if there's data to be read. I need to be notified when there is data available. Idealy I'd like to be able to receive notifications that new data is available by Windows messages, like I can do with asynchronous sockets. I have not found a way to do this with pipes/file handles though. I'd really like to stay away from threads because I don't want to have to start putting synchronization code everywhere, but right now it seems like the only option I have left. If I must use a thread, I want to try to keep it as simple as possible, i.e. do no processing in the thread, but just send Windows messages to the main thread notifying it that there's something to do.
If anybody has any thoughts or other ideas of what might be good to try for my situation, please let me know.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|