Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/07/08 16:49
Read: times


 
#157299 - Not just stack
Responding to: ???'s previous message
Life becomes a lot simpler when you don't have to worry about time and memory constraints.

But when you talk about C51 code, the problem with cooperative multitasking isn't just that each task needs to have it's own stack.

The traditional use of shared global variables for parameter passing and local variables based on call tree analysis will also be affected.

In a cooperative system, each task may have multiple calls to inform that a task switch is possible. And these calls need not be located in the outermost function, but may for example be placed in delay() calls etc.

This produces a very complex call tree - the problem is similar to a program that makes heavy use of function pointers.

That is why I say that cooperative multitasking is problematic for C51 processors.

For most other processors this wouldn't be a problem. They would keep all auto variables and parameters on the stack, so it would be enough to switch stack pointer (or swap the stack, if the processor for some reason has too little direct-mapped RAM to fit multiple stacks, but have secondary RAM that may be used as backing store).

List of 27 messages in thread
TopicAuthorDate
Non Blocking timer            01/01/70 00:00      
   Use a hardware timer            01/01/70 00:00      
      Thanks - But.....            01/01/70 00:00      
         State machines            01/01/70 00:00      
            THANKS - That's a great idea            01/01/70 00:00      
               if you have a lot to delay by various delays            01/01/70 00:00      
                  I Like that Idea as well            01/01/70 00:00      
                  A Linked List might be better here            01/01/70 00:00      
                     the correct use takes care of this            01/01/70 00:00      
                        Not necessarily            01/01/70 00:00      
   Cooperative or preemptive multitasking            01/01/70 00:00      
      Super-loop contra cooperative multitasking            01/01/70 00:00      
         Multasking can work on the 8051 ... sometimes            01/01/70 00:00      
            Not just stack            01/01/70 00:00      
               I agree            01/01/70 00:00      
                  Choose your battles carefully            01/01/70 00:00      
               I agree, too            01/01/70 00:00      
                  and            01/01/70 00:00      
                     Never underestimate the usefulnes of interrupts            01/01/70 00:00      
                        a flavor            01/01/70 00:00      
                           prioritizing in super-loop            01/01/70 00:00      
                              the fact is ..            01/01/70 00:00      
                  C works well            01/01/70 00:00      
                  Circular argument?            01/01/70 00:00      
                     Re: Circular Argument            01/01/70 00:00      
                        going round in circles            01/01/70 00:00      
            small multitasker            01/01/70 00:00      

Back to Subject List