avr-os: multitasking library

LMI:
Hey

Interesting.

How much multitasking needs memory. Is it possible to check. I am not familiar with multitasking, but I know I would need it some times. So a basic question. Is it the spinlock which yields the processing to the next task. What about interrupts. And what about very long tasks where the processing is not ready when the next task begins.

Leif

Edit: By the way, I'll probably use the mega or similar.

You can check out this file which shows you some of the memory overhead:

Each task will use 256 bytes for stack and 18 bytes for the task definition (which actually could be reduced a bit with those last 2 pointers -- start_delay_secs and delayMillis). The task stack size is configurable in the build also.

The spinlock is not used to implement multitasking. A timer interrupt is fired which will interrupt your taks's processing. If your task processing is longer than a tick then potentially a new task will be executed (and the current one is suspended).