简体   繁体   English

消息在多个进程之间传递,每个进程在c中都有很多线程

[英]Message passing between multiple processes each with many threads in c

I have an setup with multiple (roughly 32) processes each with 2 threads. 我有一个带有多个(大约32个)进程的安装程序,每个进程有2个线程。 I would like to send a message from thread 0 of process A to thread 1 of process B. So, should the message be sent specifically to the thread id or to the process id. 我想将消息从进程A的线程0发送到进程B的线程1。因此,该消息应专门发送给线程ID或进程ID。 If the message is sent to the process, by default which thread will service the message? 如果将消息发送到进程,则默认情况下哪个线程将为消息提供服务?

There are lots of ways possible. 有很多可能的方法。 Just search for IPC . 只需搜索IPC即可 For example, you could use shared memory , synchronized by a set of semaphores . 例如,您可以使用由一组信号量同步的共享内存

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM