On Mon, Apr 19, 2004 at 06:22:44PM +0100, Sergio Masci wrote: Ah. The language designers' forum. I should join in. > Wouter van Ooijen wrote > > > > Ok so the only real > > > problem is the ability > > > to do pre-emptively multitasking > > > > I consider that a serious drawback, and I would add 8 levels is a bit > > short for chips that have up to 8k of code. It depends on if the stack is accessible or not. 8 levels and a pending overflow flag should be good enough if you can access the contents of the stack. > > Hi Wouter, > > I hope you will agree that the greatest benefit in using co-operative > multitasking over pre-emptive multitasking is the ability to control where > task > switching occurs. But that's the greatest risk too. With cooperative multitasking you have to presume that everyone plays fair. If any task deliberately or inadvertently decides that it's not going to share, everyone else starves. > In large embedded systems it is often a real problem that a > task switch can occur anywhere and at any time. Often in such a system, the > tasks need to take serious measures to ensure that critical sections of code > are > not interrupted or that access to resources are serialised. That's what semaphores are for. A really short uninterruptable lock prevents multiple tasks from accessing a shared resource at the same time. > Co-operative > multitasking trashes these problems without even trying. Again at the risk of losing complete control of the system to a rogue task. > I personally consider > the lose of pre-emptively multitasking on the PIC 16 series only a small > annoyance and not a serious drawback. It's certainly worthy of debate. My plan (one day. one day) for NPCI is to implement interpreter controlled preemtive multitasking. So preemption occurs between interpreter bytecodes. This will help because it simplifies the task switching state. I leave the rest for others to ponder. BAJ -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body