- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
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:
while(1)
{
packet* p=q.pop();
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Ejaz,
I do not see whether wait_for_all is called somewhere. TBB library does not guarantee processing of spawned tasks until that moment.
TBB library has priority support (please see the documentation) but we do not recommend using it because it involves higher overheads which are not always justified since in most of the time the semantics of the workload could be changed towards better use of the library features.
As an example, I would also recommend to try splitting the processing of each packet onto several tasks to extract more parallelism from the system. Consider use of TBB Flow Graph feature because it is a good match for such sporadic (not known in advance) semantics.
Regards,
Aleksei
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Fedotoy,
Thank for hints i will try TBB Flow Graph feature, i forgot to add wait_for_all in my post.
Thanks and Regard,
Ejaz
![](/skins/images/45C6C2D737ED71F4C51F0145C8CB1E9C/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page