Reputation: 103
I need to build something like client-server app on C++. The goal is to trace multiple process with multiple threads (track function execution) and to gather this data into files divided by thread id.
Right now I've implemented this on POSIX message queues (server listens for a queue and collects data from producers), but that works very slow. Any other ideas on implementation on Linux platform (C++ language). What's the best communication way for that task? By the way, data order in the scope of one thread is very sensitive for me.
Upvotes: 0
Views: 1038
Reputation: 18631
A couple of ideas:
1) Use a fast pub-sub system. Aeron is an example of such a messaging system.
2) You could just have all the clients write to a single ledger. Then you add a reader process that polls the ledger for new data aggregates/processes the results.
There are several ways to implement such a ledger, one example is Chronicle-Queue (with some C++ implementation for v3 - cornelich).
Upvotes: 1
Reputation: 62553
Posix message queues are kernel-level thing, so they are slow. I suggest you implement your own queue using shared memory as the media - I take it, you have a multi-process (as opposed to multi-threaded) application.
Upvotes: 1