Select Page

Threads Assignment 3

  • The tasks created in the previous examples spend most of their time in the Blocked state. While in this state, they are not able to run, so cannot be selected by the scheduler.
  • There must always be at least one task that can enter the Running state. To ensure this is the case, an Idle task is automatically created by the scheduler when atomSched() is called. The idle task does very little more than sit in a loop—so, it is always able to run.
  • The idle task has the lowest possible priority (priority 255), to ensure it never prevents a higher priority application task from entering the Running state.
  • It is possible to add application specific functionality directly into the idle task function.

HowTo:

  1. Create two Tasks as in the Atomthreads Threads Assignment One
  2. Modify atomIdleThread() function in the atomkernel.c file which should print the number of idle counts.

Note: An Idle task function must never attempt to block or suspend.

References

  1. Introduction to atomthreads
  2. atomthreads kernel Reference
  3. atomthreads Documentation