The documentation seems pretty vague (nothing new there, then ) about how the system decides whether your application has multiple tasks, or just the “classic” single task with the adl_main entry point.
I guess it must first look for an adl_InitTasks table:
if it finds one, it assumes multi-tasking;
If it doesn’t find one, it assumes a “classic” single task, and requires the adl_main entry point
Does that sound right?
Is there any restriction on not naming one of your entry points “adl_main” in the Adl_InitTasks table…?
That’s been my experience to date. My bet is that the OS internally defines the adl_InitTasks table with one task called adl_main(), and the references to this internal adl_InitTasks table are overwritten (wrong term. Replaced? ) by the linker at compile time if the linker finds an explicitly defined adl_InitTasks in an object file.
Probably not - but may not be advisable to do this. However, having a adl_main() function defined in your application when using multitasking doesn’t seem to cause any hassles - it’s just never called.
I’ve found that multasking/multi threading works a treat as long as you can get your head around the asynchronous nature of the application. Also works well for decomposing your app into separate ‘modules’ that can only interact via a specific interface (messages). Makes a complicated application that much easier to debug.