[zeromq-dev] inproc: passing pointer VS zero-copy VS regular send?
Oleg Vazhnev
ovazhnev at gmail.com
Sat May 11 10:27:09 CEST 2013
Hi,
In my financial software I receive quotes from stock exchange. Each
update is something like that:
struct OrderUpdate {
uint32_t instrumentId;
uint32_t MDEntryID;
uint32_t MDUpdateAction; // 0 - New 1 - Change 2 -Delete
double /*decimal*/ MDEntryPx;
double /*decimal*/ MDEntrySize;
uint32_t RptSeq;
uint32_t MDEntryTime;
uint32_t OrigTime;
char MDEntryType;
};
I do not instatiate this structure at runtime, instead i pre-allocate
and reuse/reconfigure it (currently I actually have only ONE instance of
this structure and reconfigure it every time).
I'm going to use "inproc" binding.
I need to pass this structures from c++ to c# (later c++ to c++ cause
will move to Linux).
So far it seems I have these options:
- pass pointer (asynchronous? likely need to create ring-buffer of
strucutres)
- pass structure itself but use "zero-copy" (asynchronous? need
ring-buffer?)
- use regular "send" (if it's enough to have one instance of structure
then? at what point I can reuse it?)
As i'm absolutely novice in ZeroMQ it's hard for me to understand all
pros and cons of each approach, so looking for help from experts. I
guess that my problem is pretty general and so some "recommended"
solution exist.
Also what's better to use in my situation PUB-SUB or PUSH-PULL?
Thanks!
Oleg
More information about the zeromq-dev
mailing list