well, but my topic is just all about cooperative mode !
Sorry, I didn't know the rules.
if we put a simple chThdYield() in each loop, your exmple falls to 592876 and that was and still is my point:
we have to provide users with a strong framework and couple of exampels, otherwise they will miss-use the os and will get wrong result.
But I would never do that, I would use other features of the RTOS to handle high priority requirements. But that would break your rule that we can only use features of SCoop.
Salting yield calls at various places in code to make embedded applications work is a real pain and makes the code fragile and unreliable. You get horrible interactions between unrelated tasks.
I wrote my last cooperative scheduler in 1972. I don't plan to go back there.
I'll stick with technology I helped develop thirty years ago, the predecessor of VxWorks. VxWorks is the RTOS used in many NASA projects including all JPL Mars Rovers.
Good luck with SCoop.
Edit: here is a going away challenge, implement the ChibiOS_ARM chFastLogger example with SCoop. This example logs four ADC values at a rate of 1000 Hz. Note that ChibiOS achieves a time jitter of about one microsecond between samples. To get low SNR in a signal you need this level of jitter at 1000 Hz. See any good reference on the theory of ADC signal measurements.
I ran the example with Teensy 3.0.
Here is a bit of typical data the first column is the time in micros():