This question has been obsessing me for a few weeks but I was too much in rush to tackle it with sensible hindsight. I finally delivered a quick and dirty solution to the agog customer to relieve his fragile nerves (& also mine, as a matter of consequence). I am now finally taking time to examine this with a free mind.
Basically, I am facing the challenge of processing Synchronous Data (Time-Ordered Series) as fast as possible (<5ms). After trying to play around with many Rube-Goldberg-style designs, such as ordered thread pools and hybrid solutions involving parallel worker queues and other wonky far-fetched ideas, a thorough hands-on bench-work proved that sticking to a plain' old single threaded chain process was by far the best choice for data integrity and performance.
However, at some point in the bottom of the app, this gets to a certain limit. I need to broadcast data in a parallel fashion to different processors. And this is where my headache starts again. When I make the Data Hub (see below) send data to processors in an Asynchronous way (via a thread & a binary ring buffer), it is received in a scrambled order by the receiving party, and data order is corrupted.
So I am looking for a way to send data in a a parallel fashion to all processors, and keep order straight. My other concern is asynchronicity : If the Data Hub's SendEvent
delegate is subscribed to by processes' Receive
Method in a plain classical way (via +=
) , how is this going to behave ?
First off, I don't want the subscriptions to be called "one by one". I am sure there is a way to parallelize this. Secondly, and above all, I do certainly not want processor A to lock the whole chain until it finishes its work.
SO here it is folks. To make a long story short I want to find a sensible way to keep sending data to processors without waiting for it to be processed, but in the same time I need each Data processor to receive the data in an ordered fashion. This might sound incompatible, but I am sure there is a smart & pretty simple way to do this (But I went so deep into this I got really confused, that's why I am asking for your help, good people)