Due to index hoisting, the generated kernel looks like:
bool b = electSync();
for {
if (b) {
do something;
}
}
for {
if (b) {
do something else;
}
}
That is, we elect one thread at the beginning of the kernel, and use that thread in the entire kernel, instead of electing a ready thread everytime when there is an electSync().
Due to index hoisting, the generated kernel looks like:
That is, we elect one thread at the beginning of the kernel, and use that thread in the entire kernel, instead of electing a ready thread everytime when there is an
electSync()
.