0

I would like your opinion on the following situation and my solution:

I got 3 processes:

  1. Remote Server Application
  2. Local Server Application
  3. Local Client Application

Basically a got a list (sized around 100 items) of structs that look something like that:

struct Dummy {
    float f[16];
}

My local server receives updates from the remote server, I've no control over the remote server, it sends its updates about 20 times a second ( 20 Hz ).

Then my local server needs up update my local client with the exact same data.

The local server & client are on the same machine.

I successfully implemented a very basic client-server-PoC for the locals using pipes. The client writes to the pipe requests and the local server writes back answers which it received from the remote server.

This is not optimized: in the real world there is no need to the client to send any request because it's known beforehand exactly what data it needs.

I thought of doing the following, and I wonder if that will be optimized (we are talking about around 100 x 4 x 16 = 6400 bytes for a single data push, around 20-30 Hz so around 150-200 kb per second:

Local server creates a pipe and just updates it, around 20 times a second, around 6400 bytes each time and the local client just pull the data as fast as it can.

I wonder if there might be a better way - that way is super simple and easy to implement but I wonder performance wise if that is the best way.

Lucifer M
  • 21
  • 3
  • will be better if your *Local Server Application* create shared memory section and will be update data inside it. and *Local Client Application* will be read data from this section – RbMm Nov 02 '17 at 13:59
  • @RbMm I thought this is exactly what pipe does... is it not? – Lucifer M Nov 02 '17 at 14:06
  • of course not. how i understand your task - use shared memory is best way. + you need use mutex for access/modify data synchronization – RbMm Nov 02 '17 at 14:08
  • Remove this question, it will get closed as offsite topic as it asks for suggestions and opinion and not a solution to a problem – Vedant Nov 02 '17 at 14:08
  • If you are a newbie, to C++ you can simply use files – Vedant Nov 02 '17 at 14:09

0 Answers0