Visible to Intel only — GUID: iga1464370386374
Ixiasoft
Visible to Intel only — GUID: iga1464370386374
Ixiasoft
7.4.4.2.1. NicheStack Thread Priorities
Intel’s version of the NicheStack networking stack relies on the MicroC/OS-II operating system’s threads to drive two critical tasks to properly service the networking stack. These tasks (threads) are tk_nettick, which is responsible for timekeeping, and tk_netmain, which is used to drive the main operation of the stack.
When building a NicheStack-based system in the Nios® II EDS, the default run-time thread priorities assigned to these tasks are: tk_netmain = 2 and tk_nettick = 3. These thread priorities provide the best networking performance possible for your system. However, in your embedded system you might need to override these priorities because your application task (or tasks) run more frequently than these tasks. Overriding these priorities, however, might result in performance degradation of network operations, as the NicheStack networking stack has fewer processor cycles to complete its tasks.
Therefore, if you need to increase the priority of your application tasks above that of the NicheStack tasks, make sure to yield control whenever possible to ensure that these tasks get some processor time. Additionally, ensure that the tk_netmain and tk_nettick tasks have priority levels that are just slightly less than the priority level of your critical system tasks.
When you yield control, the MicroC/OS-II scheduler places your application task from a running state into a waiting state. The scheduler then takes the next ready task and places it into a running state. If tk_netmain and tk_nettick are the higher priority tasks, they are allowed to run more frequently, which in turn increases the overall performance of the networking stack.