Page 265 - Embedded Microprocessor Systems Real World Design
P. 265

A                                B
                    BLOCK SIZE TOO SMALL             BLOCK SIZE TOO LARGE


                   MEMORY BEFORE ALLOCATION        MEMORY BEFORE ALLOCATION
                   BLOCK
                     1
                    2
                    3
                    4
                    5
                    6
                    7
                    8
                    9
                    10
                    11
                    12
                    13
                    14
                    15
                    16
                        FRAGMENTED MEMORY
                   BLOCK              ALLOCATION                     ALLOCATION
                     1
                    2                                                TASK 1
                    3                 TASK  1
                    4                 TASK 2
                    5
                    6                 TASK 2
                    7                                                TASK 2
                    8
                    9                 TASK 3
                    10                TASK 3
                    11                TASK 3                         TASK 3
                    12                TASK 3
                    13
                    14                TASK 4                         TASK 4
                    15                TASK 4
                    16


                                                                        =FREE
                                                             -1         - ALLOCATED (UNAVAILABLE)


                  Figure 9.4
                  RTOS Memory Allocation Blocks.



                  output  task,  the  diagnostic task must wait until  the  interface is  released  by  the
                  output code.
                     In the  area of  timers, the RTOS may  provide system timers, implemented  in
                  software and counting timer ticks, that can be allocated like any other resource.
                  These timers, of course, cannot time anything with a resolution less than the timer
                  tick interval.


                  246                                             Embedded Micropocessm Systems
   260   261   262   263   264   265   266   267   268   269   270