You could have several threads, one per port to listen to. But then you'll need to make sure you have locking or some other queuing discipline so that if two threads try to push to the same queue at the same time things don't get corrupted.
Is the main thread overloaded because there are many small messages or because there are fewer very large messages? (Is this a UDP-based approach where the main thread gets a packet, pushes data to a queue and is then done or is it a stream-based (TCP) approach where there is a significant ongoing conversation?)
If your cores are at 0-10%, does that mean that you are I/O bound? If the processing isn't very CPU intensive then perhaps your bottleneck isn't the CPU's at all. In which case, it seems doubtful that more concurrency at the processor level will be helpful. Or do you know that there is a significant amount of computation in progress?
8.5MB/sec = 68Mbit per second -- well below the capacity of a gigabit LAN card...unless the switch itself is the bottleneck. Do you know that the switch is in fact gigabit to all ports? (I know that most of the switches I have worked with, if they have gigabit links at all, it's only one or two uplink ports.)
|