#include #include #include #include #include #include #define LOOPS 100000 int main (void) { unsigned long long t0, t1; int pipe_1[2], pipe_2[2]; int m = 0, i; pipe(pipe_1); pipe(pipe_2); if (!fork()) { for (i = 0; i < LOOPS; i++) { read(pipe_1[0], &m, sizeof(int)); write(pipe_2[1], &m, sizeof(int)); } } else { for (i = 0; i < LOOPS; i++) { write(pipe_1[1], &m, sizeof(int)); read(pipe_2[0], &m, sizeof(int)); } } return 0; }