2个Windows c ++ .exes通话的最佳方法是什么? [英] what's the best way for 2 windows c++ .exes to talk?

查看:88
本文介绍了2个Windows c ++ .exes通话的最佳方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要给我写一个合成器.
(为我自己的恶意目的,调整现有的合成代码)

我已经有一个Midi音序器应用程序. (用于编辑注释等)

而且我希望合成器是一个独立的.exe,因为它是另一种野兽,并且可以在其他内核上运行,这很好,等等.

所以现在我想出了发送midi字节的最佳方法
(并加载c:\ THISpiano.patch消息等)
从音序器.exe到合成器.exe

我想内存映射文件是Windows方式,是吗?
Sequencer应用程序将打开mem映射文件并写入共享的mem.
Synth应用程序会打开相同的内存映射文件,并从共享的内存中读取.

有人在Windows上进行进程间对话时有其他高性能技术吗?特别是通过本机c ++应用程序?
谢谢你!

...史蒂夫


其实,虽然我在这里,但如果我确实使用了内存映射文件,
有没有办法让我等待而不是在忙碌的循环中旋转
不断更改共享内存中的任何内容?

无论何时,只要有任何注释,它都会处于繁忙循环中.
但是当事情变得寂静时(笔记/声音全没了)

I''m gonna write me a synth.
(well, tweak existing synth code for my own nefarious purposes)

I already have a midi sequencer app. (that edits notes and such)

And I''d like the synth to be a seperate .exe since it''s a different sort of beast and would be nice to have runnin on another core, etc.

So now i gotta come up with the best way to send midi bytes
(and load c:\THISpiano.patch messages, etc, etc)
from the sequencer .exe to the synth .exe

I guess memory mapped files are the windows way, eh?
Sequencer app opens mem mapped file and writes to shared mem.
Synth app opens same mem mapped file and reads from shared mem.

Anybody got any other hi performance techniques for inter process talkin on windows - especially by a native c++ app?

thanks mucho!

...Steve


Actually, while I''m at it here, if I DO use mem mapped files,
is there a way for me to WAIT and not spin in a busy loop looking
constantly for any change in shared mem?

It''ll be in a busy loop ANYway when there are ANY notes on.
But when things are silent (notes/voices are all off)
it could be nicer to the cpu.

推荐答案

您可以使用TCP/IP套接字.就性能而言,这可能是最好的方法...
You could use TCP/IP sockets. that''s probably the best way in terms of performance...


好吧,我有一段时间没有做任何事情了,但是您是否考虑过使用此
http://msdn.microsoft.com/en-us/library/ms649009 (v = VS.85).aspx [
Well, I haven''t done any of this in some time, but did you consider using this
http://msdn.microsoft.com/en-us/library/ms649009(v=VS.85).aspx[^]?


嘿,我,

您可以在单独的线程上添加合成代码.
那会让它在单独的内核上运行并基于消息.
(线程的msgloop)

但是你必须编译你的大油菜
带有所有
的sequencer + synth .exe 在clib中浮动启动/支持代码.

而且您真的不想包含其中的内容
如果不需要,请在您的Midi音序器中使用.

因此,请让您的Midi音序器在Sep .exe中自由浮动.
和合成器(必须具有浮点数)位于sep .exe中.

所以,好的,是的,坚持我猜的两个.exe,我...

...我
hey me,

you could add the synth code on a seperate thread.
that''d let it run on a seperate core AND be message based.
(thread''s msgloop)

BUT you''ld have to compile your big ole
sequencer+synth .exe with all the
float startup/support code in clib.

And you really don''t want to have to have that included
in your midi sequencer if you don''t have to.

So keep your midi sequencer float free in a sep .exe
and the synth (which HAS to have floats) in a sep .exe

so, ok, yeah, stick with the 2 .exes i guess, me...

...me


这篇关于2个Windows c ++ .exes通话的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆