阅读背景:

Linux在多核处理器/ SMP中的3个进程(每个进程在不同的核心中运行)之间共享内存

来源:互联网 

Purpose:

目的:

I want to synchronize three different processes, so I thought of using shared memory between the processes. So I have forked two child's from one process and created a shared memory segment before creating the child's. My intention is to run the child processes and parent process in different cores to make it parallel execution. So I have used the affinity control to assign the according CPU. Both the child's will wait in indefinite while loop (consuming on the same CPU which is assigned) until it gets the trigger from the parent via shared memory. So when the parent writes some specific character/string, the child should come out loop and start executing the rest of the code.I want to synchronize three di




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: