My application is VDK + LwIP based.
The program flow goes like this :-
I have two threads 1- Consumer (ether output), 2- Producer(ether input).
The producer uses a blocking "recvfrom" call to wait for any packet to receive.
The consumer is triggered every 1ms to process that packet and send out new packet using "sendto" since I am using UDP sockets.
My unit work in a pair, so there are always two units both sending and receiving simultaneously.
The problem is, the "sendto" call alone takes most of my CPU load (monitored through VDK debug history window). If i comment out the sendto call and recvfrom calls and use dummy data to produce and consume, the CPU load goes down to around 20% CPU load. But as soon as i enable "sendto" call, the graph shows peaks reaching 100% CPU load, and if i enable recvfrom call too the line goes Flat to 100%.
The packet traffic is realtime voice traffic (uncompressed, 32 channels of 64kbps) . I am confused if LwIP is capable of handling 1000 packets/s on receiving side and another thread transmitting 1000 packets/s.
Or can anyone suggest what might be going wrong ?