Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
20 years ago

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

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.
No RepliesBe the first to reply