Using for or while loops for embedded code

it sounds like you're eager to understand and find a use for a multi-tasking application rather than focusing on good programming techniques

Actually I'm eager for both of these aspects. I want to understand multi-tasking more than wanting to find a use because I have a plan to run it in.

For example, if there is a machine that has different modules that require initialization functions and each module has initialization functions that require some delay, then I would rather call other modules functions in this delay time to get a fast boot time. Also in run time, I need multitasking.

And after going through developing projects, I will learn some good programming techniques, without practicing I will learn nothing.

The idea is what drives me to do something, and not relying on everyone's code, that way I will not learn how to develop a code for a device or task manager.

when you're the sole developer of an application, you might have several function calls within some loop, where each function completes execution within a reasonable amount of time.

Yes, but if the functions are for specific module; like, a display, then how would I manage calling and initializing other modules functions ?

For example, the lcd128x64 requires a delay for each dat a transmission of 72us, so my idea is that I can do something in this period of time. Otherwise, if I ignored this period of time and ran a whole frame with a blocking for loop which is 1024 pixles x 72us = 73.7ms it still quick but I would rather leave the system not to be blocked for this amount of time.

for processors such as an arduino, the expense in lost performance from an OS is unnecessary

Yes, maybe but this is a programming practice that can move with me if I go to more faster chips.

the last few projects in optics and software radio used vxworks and embedded linux and required a different mindset that was more message based.

I hope you provide links to these projects so I can learn from them.

i'm trying to imagine the use case for a "coroutine" that has one or more "yield" points within it rather than just completing all processing within a "reasonable" amount of time and returning to the calling function (e.g. loop())

This is smart point of coroutines, actually there is a static variable that stores the last line of that function when it gets the temporary exit action with co_delay
, then when the function is called again, the CO_BEGIN has a switch statement that jumps directly to the last line the function stopped at.

there may be good reasons or particular applications to use "coroutines", but they don't seem very common, especially on arduino.

I agree with you, but I want to investigate as much as I can in coroutines, and also I want to learn other techniques.

The concept of coroutines is ok with me, my issue now is the calling of functions from void pointers, pass and unpack their arguements.