Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12606 Discussions

What's the best way to assign priorities to tasks?

Altera_Forum
Honored Contributor II
959 Views

Recently I ran into an issue where I needed a low-priority task to temporarily be high-priority. The solution I came up with was to write a small function that repeatedly called OSTaskChangePrio() until it found a free priority, then do the swap. 

 

Did I reinvent the wheel? It seems like this functionality should already exist in a multithreaded OS, especially when the number of available tasks is so small. Functions like getLowestFreePriority, getHighestFreePriority, etc.
0 Kudos
0 Replies
Reply