Multitasking or MultiThreads with SPLat as an example


i chuckle when see comments like, "what doing needs multitasking?"   unless you've tried it, can't come close appreciate programme design power in hands.  let me explain.

splat controls in australia have multitasking technology quite simple use controllers.  assume have 2 independent programmes: 1 called pushbutton , other fillcontrol. first monitors group of pushbuttons , sets flags read other programmes.  second has focus on filling tank function of pushbutton flags.  functions descriptive, "task" more applicable. 

the code:
                   launchtask   pushbutton
                   launchtask  fillcontrol
                   runtasksforever

pushbutton
                   yieldtask
                    ......
                    ......
                    goto pushbutton
fillcontrol
                    ......
                    wait
                    ......
                    goto fillcontrol

if there timing event or pause, there no effect on technique.  controller check timing or pause condition, if hasn't been met, leave task , execute next task @ point had left off.   if second task has timing or pause condition , conditions hasn't been met, leaves task , returns first left off.   if there no timing or pause conditions in task, first line in task should include yieldtask exit task.  seems odd when controller returns, starts off left off.... skips leave statement, executes task, returns top , leaves.  of course, under hood have files points , such need not have worry about.  of course, have more 2 tasks.  imagine 20 tight small programmes easy maintain or troubleshoot.  comment out launch line quite easily.  or redirect test task.

i love concept , used product number of times.  reduces programming , fits nicely object programming techniques.  have low cost controller called ec1 try out.  hope still have it.

i love use arduino in similar fashion.  mega2560 have power it.  anyone?

ps....  wrote above reply similar inquiry mulitasking.   i felt used start new thread. 

thanks, @torontofred. it's interesting discussion. of course multitasking great. have consider implementation details , software environment. standardization , resource allocation 2 large obstacles adoption of pre-emptive multitasking on arduino. have consider there no kernel or bios in arduino world. also, many users beginners , want learn simple, basic code. many, use of library functions challenge. in way, great can design programs stand alone, because out in open , can seen. also, round-robin multitasking can of things pre-emptive system can (in limited hardware environment). let fun begin. there lot of opinions on subject.


Arduino Forum > Using Arduino > Programming Questions > Multitasking or MultiThreads with SPLat as an example


arduino

Comments