This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

What is the concept of Multitasking, and how I reduce my code

Is Multitasking concept, is division of every task in equal timing please guide me further about it and how I reduce my code. Is any help about assembly language.

Parents
  • Well, that's something of a long answer. Perhaps you should start with some general background on real-time operating systems.

    http://www.faqs.org/faqs/realtime-computing/faq/index.html

    Tasks can be scheduled in many different ways. Equal time slices is one of the simplest. Perhaps the most common is an absolute priority scheme, where the highest priority task runs until it it done, combined with round-robin scheduling of tasks at equal priority driven via a timer interrupt.

    Using an RTOS is probably not going to make your code smaller (unless they've implemented some libraries more efficiently than you did). There's a certain amount of overhead to be able to arbitrarily interrupt a task and resume where it left off at some later time. It does, however, make your code much easier to read and write, as well as generally making it easier to make sure that things happen on schedule. I'd expect to see RTOSes appear in complex programs, but not in ones where size is crucial.

    Just about any RTOS you buy will be supplied as a library of functions which you could call from assembler as easily as a high-level language.

Reply
  • Well, that's something of a long answer. Perhaps you should start with some general background on real-time operating systems.

    http://www.faqs.org/faqs/realtime-computing/faq/index.html

    Tasks can be scheduled in many different ways. Equal time slices is one of the simplest. Perhaps the most common is an absolute priority scheme, where the highest priority task runs until it it done, combined with round-robin scheduling of tasks at equal priority driven via a timer interrupt.

    Using an RTOS is probably not going to make your code smaller (unless they've implemented some libraries more efficiently than you did). There's a certain amount of overhead to be able to arbitrarily interrupt a task and resume where it left off at some later time. It does, however, make your code much easier to read and write, as well as generally making it easier to make sure that things happen on schedule. I'd expect to see RTOSes appear in complex programs, but not in ones where size is crucial.

    Just about any RTOS you buy will be supplied as a library of functions which you could call from assembler as easily as a high-level language.

Children