Inter-process communication

前端 未结 9 1465
傲寒
傲寒 2020-12-01 08:42

I have two applications: X and Y.
X is the main application and it handles a lot of XML files. It has a history of more than 10 years and half a dozen techniques have

9条回答
  •  盖世英雄少女心
    2020-12-01 08:53

    Named pipes are fast, because they are based on memory mapped files, for their implementation. What could be slow is the timeout in case of server failure...

    If you need to have fast response on the same computer, why don't you use good old GDI messages?

    You can use these messages, even with no User Interface or visual form, in plain console or background service applications (in case of a service application, the security settings must specify that this service must interact with the desktop, that is, must be able to receive and send messages).

    The trick is to handle WM_COPYDATA messages. See for example our TSQLRestClientURIMessage class, and the ExportServerMessage/AnswerToMessage methods of TSQLRestServer, as implemented in http://synopse.info/fossil/finfo?name=SQLite3/SQLite3Commons.pas

    In practice, I found out that GDI messages are much faster than named pipes for small amount of data (up to 64 KB or such per message).

    You have alternatives in Looking for an alternative to windows messages used in inter-process communication

提交回复
热议问题