By: Moritz (better.delete@this.not.tell), March 22, 2021 12:40 pm
Room: Moderated Discussions
Jukka Larja (roskakori2006.delete@this.gmail.com) on March 22, 2021 7:11 am wrote:
> > Then do not spawn an actual thread but only let the compiler add/sprinkle the instructions into
> > the normal flow of the main task at times it assumes there is a stall or free capacity.
>
> Consider usual flow of code: 1) do some thing, 2) use results of
> work done in 1), 3) use results of work done in 1) and 2) etc..
>
> At which point does the "sprinkling of instructions into the normal flow" happen?
> Unless the compiler is magical, the simple to write pattern is to annotate some
> work as parallel, wait for it to complete and continue to next part.
You said there were two parallel tasks that needed interleaving.
I suggested not to have two threads that are explicitly interleaved by the processor but have the compiler mix/reorder the instructions in one context and let the processor find the ILP.
> > Then do not spawn an actual thread but only let the compiler add/sprinkle the instructions into
> > the normal flow of the main task at times it assumes there is a stall or free capacity.
>
> Consider usual flow of code: 1) do some thing, 2) use results of
> work done in 1), 3) use results of work done in 1) and 2) etc..
>
> At which point does the "sprinkling of instructions into the normal flow" happen?
> Unless the compiler is magical, the simple to write pattern is to annotate some
> work as parallel, wait for it to complete and continue to next part.
You said there were two parallel tasks that needed interleaving.
I suggested not to have two threads that are explicitly interleaved by the processor but have the compiler mix/reorder the instructions in one context and let the processor find the ILP.