On Sat, Oct 11, 2003 at 09:34:03PM -0500, Gonzalo Jim?nez wrote: > Thanks all for your answers, > > Well I was trying to do multitasking just becasuse it seems to be better > than a "super loop" even though a "super loop" can work very well, From a programming abstraction point threads can give an advantage if all things are equal. But in a PIC since the interrupt stack/stack pointer is hidden from the programmer, all things are not equal. So generally the effort require to implement threading by hand isn't worth the effort. Next year, once I finally finish my dissertation, I plan to dust off my NPCI interpreter http://www.finitesite.com/d3jsys/README-NPCI.html and implement threading. Since I expose my interpreter stack, it should be fairly easy to do. But the super loop as you call it, coupled with any interrupts required for faster processing, is a perfectly acceptable way to handle an application that requires multiple tasks. BAJ >thanks > for your ideas, I guess I could modify the code I posted before to work > with more tasks at least in one page it seems to work :) > > My idea is to store two register for each task, one to store the address > where it must continue working and the other to store the addrees it must > work next time the task is called, with that you can yield control > everywhere anytime inside a task, at least in simulations it worked... > > Thanks again, tim, Segio, Olim... if I miss somebody I'm sorry... -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu