Slide 1 Slide 2 Slide 3 Slide 4 Slide 5 Slide 6 Slide 7 Slide 8 Slide 9 Slide 10 Slide 11 Slide 12 Product List
RTOS and Software Interrupts Slide 4

It was mentioned before that Hwis and Swis are similar in design. One can use the same state diagram to describe both of these thread types: after creation, they are inactive until they are posted by some event – that is, a hardware interrupt or a call to Swi_post – at which point they are made ready to run. If the thread that is ready to run is the highest priority thread, it will immediately start running and it will always run to completion and cannot be suspended or terminated prior to that; it can only get preempted by a higher priority thread. Both Hwi’s and Swis will run only once regardless of how many times the thread was posted prior to it starting to execute. For some systems, however, it may be important for the Swi function to comprehend how many times a post actually occurred before the function started executing. For these cases, SYS/BIOS provides a special posting API called Swi_inc(). If a Swi is posted while its function is busy executing, the scheduler will queue the Swi to execute again after the current function is done executing. However, it will be queued in FIFO order. This means if there was another Swi posted ahead of it that was at the same priority, that one would execute first.

PTM Published on: 2012-07-17