Question: If two processes use a pipe to exchange a large amount of data on a multi-processor system, the communication should be faster if the processes
If two processes use a pipe to exchange a large amount of data on a multi-processor system, the communication should be faster if the processes run on the same CPU than if they run on different CPUs. The reason is that when the two processes runon the same CPU, the pipe data will be more quickly accessed because it can remain in that CPUs cache. By contrast, when the processes run on separate CPUs,the benefits of the CPU cache are lost.
Think about a potential test case that can be used to demonstrate this behavior. Provide a simple C++ for your test program. (HINT: investigate the Linux sched_setaffinity() system call).
**Edit: That is how the question was asked on homework. My interpretation of it is to write a small C++ program that uses sched_setaffinity() and demonstrate how two processes on the same processor (CPU) will run faster than using parallel programming (threaded, fork(), etc).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
