topic Need Help for an Implementation. in IntelĀ® oneAPI Threading Building Blocks
https://community.intel.com/t5/Intel-oneAPI-Threading-Building/Need-Help-for-an-Implementation/m-p/794792#M1930
Hi All,<BR /><BR />I have one task defined as this:<BR /><BR />Reader which provides data to parallel parsers(P) , denoted bye this:<BR /><BR />task = R , P(1)...P(n)<BR /><BR />legend:<BR /><BR />R = Reader<BR />P = Parser<BR />R must complete before P(1)...P(n) are started in parallel.<BR /><BR />We want to create parallel tasks but the R in task T cannot begin bofore the R in task T-1 is complete.<BR /><BR />Readers cannot run in parallel, parsers can run in parallel even between tasks.<BR /><BR />So, in time order, the tasks would go in this order in a parallel environment...<BR /><BR />"..." means sub-tasks runs that long time.<BR />+ = sub-task completion time.<BR /><BR />task T-1: R ......+ P(1) ..... P(n)<BR /> |<BR /> |<BR />task T: R...+ P(1).....P(n)<BR /><BR /><BR />How would something like this be accomplished in TBB.<BR /><BR /><BR />Thanks,<BR />Regards,<BR />Ankush Garg.<BR /><BR />Wed, 03 Nov 2010 08:09:36 GMTer_ankushgarg2010-11-03T08:09:36ZNeed Help for an Implementation.
https://community.intel.com/t5/Intel-oneAPI-Threading-Building/Need-Help-for-an-Implementation/m-p/794792#M1930
Hi All,<BR /><BR />I have one task defined as this:<BR /><BR />Reader which provides data to parallel parsers(P) , denoted bye this:<BR /><BR />task = R , P(1)...P(n)<BR /><BR />legend:<BR /><BR />R = Reader<BR />P = Parser<BR />R must complete before P(1)...P(n) are started in parallel.<BR /><BR />We want to create parallel tasks but the R in task T cannot begin bofore the R in task T-1 is complete.<BR /><BR />Readers cannot run in parallel, parsers can run in parallel even between tasks.<BR /><BR />So, in time order, the tasks would go in this order in a parallel environment...<BR /><BR />"..." means sub-tasks runs that long time.<BR />+ = sub-task completion time.<BR /><BR />task T-1: R ......+ P(1) ..... P(n)<BR /> |<BR /> |<BR />task T: R...+ P(1).....P(n)<BR /><BR /><BR />How would something like this be accomplished in TBB.<BR /><BR /><BR />Thanks,<BR />Regards,<BR />Ankush Garg.<BR /><BR />Wed, 03 Nov 2010 08:09:36 GMThttps://community.intel.com/t5/Intel-oneAPI-Threading-Building/Need-Help-for-an-Implementation/m-p/794792#M1930er_ankushgarg2010-11-03T08:09:36ZNeed Help for an Implementation.
https://community.intel.com/t5/Intel-oneAPI-Threading-Building/Need-Help-for-an-Implementation/m-p/794793#M1931
Use a pipeline with a serial filter for the reader and a parallel filter for the parser.Wed, 03 Nov 2010 08:53:32 GMThttps://community.intel.com/t5/Intel-oneAPI-Threading-Building/Need-Help-for-an-Implementation/m-p/794793#M1931RafSchietekat2010-11-03T08:53:32ZNeed Help for an Implementation.
https://community.intel.com/t5/Intel-oneAPI-Threading-Building/Need-Help-for-an-Implementation/m-p/794794#M1932
As Raf suggests, use a parallel-pipeline. This is an ideal candidate.<BR /><BR />>><EM>We want to create parallel tasks but the R in task T cannot begin bofore the R in task T-1 is complete<BR /><BR /></EM>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.<BR /><BR />Jim DempseyWed, 10 Nov 2010 14:04:16 GMThttps://community.intel.com/t5/Intel-oneAPI-Threading-Building/Need-Help-for-an-Implementation/m-p/794794#M1932jimdempseyatthecove2010-11-10T14:04:16Z