I'm trying to build the receiving end of my system, which sends UDP segments over a Gigabit Ethernet link. I have tried so far both Matlab and Python, but neither solution seems to be efficient. I always encounter huge drop rates, which cannot be explained by the fact that UDP is unreliable. I suppose that I don't read the incoming buffers fast enough and so new frames get discarded.
My question is, would a C/C++ implementation be faster that Matlab and Python?
And what about threads? Would that improve the situation? I'm thinking of a producer/consumer scheme. One thread for handling the UDP socket, another for processing the incoming segments. However I still have some doubts about this. For instance, if I use mutexes this means that the producer cannot write to the queue while the consumer reads from there. And that means that still the producer will be stalled by the operation of the consumer. Am I wrong in this?