04-20-2017 12:33 PM - edited 04-20-2017 12:34 PM
Here is the code simplified some and turned into a pipeline.

04-21-2017 03:29 AM
What can I say crossrulz, the application has extremely demanding requirements!
The suggestion about using a pipeline architecture to take advantage of multiple processors certainly seems a good one at first glance. Focussing on performance only, when I tried to decouple the processing from the sampling in the producer/ consumer architecture it didn't improve matters, actually that was slightly worse, so I went back to my original single loop. I will try your suggestion next and see if that helps. Thanks.