Hello,
Now that I have read about named costates, I am starting to wonder about code design alternatives. Which of the below methodologies would be best?
costate {
waitfor(cond1);
…
}
costate {
waitfor(cond2);
}
if (cond1)
costate {
…
}
if (cond2)
costate {
…
}
costate task1 {
…
}
costate task2 {
…
}
costate {
if (cond1) CoBegin(task1);
if (cond2) CoBegin (task2);
}
Questions:
a. Is it better to have waitfor() guard conditions or if statements?
b. Can anyone give me a good example of when to use the third method? (selectively starting tasks)
Thanks