VM vs Native & task starting

Discussion of issues related specifically to writing code for native mode devices. This includes ZBasic code as well as assembly language code and C code, both inline and standalone.
Post Reply
FFMan
Posts: 502
Joined: 09 January 2010, 12:52 PM

VM vs Native & task starting

Post by FFMan »

through an error in my code, my program accidentally call the starttask command twice in the initialisation section.

the zx24p didn't seem to mind and this is why i didn't notice it. However, when moved to the zx24n it appeared to be a different story and the program gave unexpected results with the i2c routines apparently then failing to work.

i didn't do much investigation except to say when the starttask was called once all was ok on bot devices.

I expect i'm pretty much the only person to do this, but i thought it might be of interest.
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Re: VM vs Native & task starting

Post by dkinzer »

FFMan wrote:my program accidentally call the starttask command twice in the initialisation section.
The result of doing so is that the same task stack is being used multiple tasks that are active at the same time. The documentation for CallTask indicates that this should not be done but it doesn't describe what will happen if you do. Essentially, the behavior is undefined so both observed results, although different, are "correct".
- Don Kinzer
Post Reply