I am working on a socket application, my app is receiving very fast packets and i have to process and replay each packet within specific time (say 100 milliseconds). i am adding every packet to a queue, a thread is picking a packet and executing a tbb::task to process packet. i have 16 cores, and not able to process all packets in given time.
my question is can i change task priority to high or kill task which is not started in 50 ms and execute new task ?
what i am doing in my queue processing thread is:
process_packet* task = new(tbb::task::allocate_root()) process_packet(this,p);
class process_packet: public tbb::task
process_packet(Parent *pPtr,Packet* pData)
another question ,is it right approach to process socket packets, i don't know how much packets i will receive.
Thanks & Regards,