Wouter van Ooijen escreveu: >> The idea is that the compiler add the code automatically every few >> normal program instructions. >> >> This is just a theoretical idea, I don't think it may be useful because >> of its low efficiency. >> = > > Do you realise that 12/14 bit core PIC code (whether hand-assembly or = > compiler generated) generally uses global variables, and is hence not = > re-entrant? To make your idea work you would have to make unique copies = > of all code that is shared between threads. > = Yes, as I said, it is just *possible* but not efficient or even useful. Many short functions may run atomically. Larger ones may access variables thorough a "task private data pointer". Too much trouble. And there is also the problem that you may not use call/return, you must manage the call stack in software. I'm not advocating that anyone use such a wicked thing, there are much better solutions, but it may be possible... Regards, Isaac __________________________________________________ Fa=E7a liga=E7=F5es para outros computadores com o novo Yahoo! Messenger = http://br.beta.messenger.yahoo.com/ = -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist