
www.Usenet.com
| <-- __Chronological__ --> | <-- __Thread__ --> |
+--------------- | My guess is that compilers would end up forced to stick yield | instructions into nearly every basic block... +---------------
Not necessarily -- only those blocks which end with a *backwards* branch. For branches that implement an N-way fork/merge flow path, the compiler can just keep track of the maximum duration of any fork, for example. [But also see the above-mentioned papers on deferring other kinds of tests, which cover the case when one fork is much more expensive than the others.]
But even if you did have to...
In similar vein the Transputer treated unconditional backward branches as places where the CPU could be rescheduled to another thread. (Which is why the registers (A,B,C) were documented as not being preserved over a backward branch).
-- -- Jim
James Cownie <[EMAIL PROTECTED]> Etnus, LLC. +44 117 9071438 http://www.etnus.com
| <-- __Chronological__ --> | <-- __Thread__ --> |