Hi fat16lib, how are you ?
fat16lib:
Why would anyone put a yield in a loop with a preemptive RTOS? That's what round robin is for.
well, but my topic is just all about cooperative mode ! and also you recently published an example in coop mode, thats why I thought it would be interesting to provide a basic comparison out of the box in coop mode. in such a case you might recognize that yield() is and must be used as much as possible to provide fluent time sharing.
With proper design ChibiOS does over seven million increments, seven times better than SCoop.
you are right, you reach 7 million counts, in preemptive mode. I cannot do such a test as I do not support this mode.
but 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.so at this time we could propose a deal: SCoop for cooperative and chibiOS for preemptive !
but if I was a user lloking for a simple and efficient multitasking solution, I would love to see a chibiOS-wrapper, user oriented, that would combine the best of these both worlds !