1

I am creating a simple client/server interface via pipes. When the server gets a request from the client, it forks to create the handler process.

I'm doing a rough implementation right now, so most of the data is held within an array of structs:

struct data{
    int value;
    char* description;
}

struct data events[100];

I need to, after the child process completes its job (which involves editing the structs within the array to have values and descriptions passed in by the client), send this data back to the server and refresh the server's events[] array, so that when it forks again from another request, the fork has the correct data within the array.

What can I use to do this?

Ajv2324
  • 422
  • 8
  • 24

1 Answers1

1

Shared memory is the first thing that comes to mind.

Or you could just shove the bits over the pipe you already claim to have.

Community
  • 1
  • 1
Paul J. Lucas
  • 6,895
  • 6
  • 44
  • 88