- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi All,
I have one task defined as this:
Reader which provides data to parallel parsers(P) , denoted bye this:
task = R , P(1)...P(n)
legend:
R = Reader
P = Parser
R must complete before P(1)...P(n) are started in parallel.
We want to create parallel tasks but the R in task T cannot begin bofore the R in task T-1 is complete.
Readers cannot run in parallel, parsers can run in parallel even between tasks.
So, in time order, the tasks would go in this order in a parallel environment...
"..." means sub-tasks runs that long time.
+ = sub-task completion time.
task T-1: R ......+ P(1) ..... P(n)
|
|
task T: R...+ P(1).....P(n)
How would something like this be accomplished in TBB.
Thanks,
Regards,
Ankush Garg.
I have one task defined as this:
Reader which provides data to parallel parsers(P) , denoted bye this:
task = R , P(1)...P(n)
legend:
R = Reader
P = Parser
R must complete before P(1)...P(n) are started in parallel.
We want to create parallel tasks but the R in task T cannot begin bofore the R in task T-1 is complete.
Readers cannot run in parallel, parsers can run in parallel even between tasks.
So, in time order, the tasks would go in this order in a parallel environment...
"..." means sub-tasks runs that long time.
+ = sub-task completion time.
task T-1: R ......+ P(1) ..... P(n)
|
|
task T: R...+ P(1).....P(n)
How would something like this be accomplished in TBB.
Thanks,
Regards,
Ankush Garg.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Use a pipeline with a serial filter for the reader and a parallel filter for the parser.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As Raf suggests, use a parallel-pipeline. This is an ideal candidate.
>>We want to create parallel tasks but the R in task T cannot begin bofore the R in task T-1 is complete
In a parallel pipeline there is the concept called a token. Pipelinesthe number of tokensfactors into the extent of the desired parallelism (min(number of threads, number of tokens)).The token(s) is(are) passed about such that no two tasks (threads) have possession ofany one tokenat the same time. In your case, the token could contain an I/O buffer plus any other temporary buffers and state variables.
Jim Dempsey
>>We want to create parallel tasks but the R in task T cannot begin bofore the R in task T-1 is complete
In a parallel pipeline there is the concept called a token. Pipelinesthe number of tokensfactors into the extent of the desired parallelism (min(number of threads, number of tokens)).The token(s) is(are) passed about such that no two tasks (threads) have possession ofany one tokenat the same time. In your case, the token could contain an I/O buffer plus any other temporary buffers and state variables.
Jim Dempsey

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page