[En-Nut-Discussion] Thread priority
Ernst Stippl
ernst at stippl.org
Tue May 15 21:52:47 CEST 2007
Hi Michel!
This comment was added in version 4.1.9, it did not exists in 4.1.4
Interestingly, the ocde of NutThreadSetPriority has not changed (besides 3
"#ifdef NUTDEBUG")
I grep'ed for NutThreadSetPriority (output below) and it canbe seen that
Seems like a "OS versa apps" divide here. Only device driver threads have
prios lower than 32.
The important thing is that some quite undesired effects may occur when
interfering with them.
Make sure you are giving up the CPU fast enough when running on such prio!
regards
ernst
-------------------------------------
I:\ethernut_4.1.9\nut>grep -d+ NutThreadSetPriority *.*
File ChangeLog:
* os/thread.c: Rewrote CS in NutThreadSetPriority
NutTimer0Intr, NutEventWait, NutThreadYield, NutThreadSetPriority,
File app\basemon\basemon.c:
NutThreadSetPriority(254);
NutThreadSetPriority(128);
File app\events\events.c:
NutThreadSetPriority(32);
NutThreadSetPriority(96);
File app\httpd\httpserv.c:
NutThreadSetPriority(254);
File app\nutpiper\display.c:
NutThreadSetPriority(128);
File app\nutpiper\scanner.c:
NutThreadSetPriority(128);
File app\rs232d\rs232d.c:
NutThreadSetPriority(64);
NutThreadSetPriority(128);
File app\threads\threads.c:
NutThreadSetPriority(16);
NutThreadSetPriority(128);
File app\timers\timers.c:
NutThreadSetPriority(4);
NutThreadSetPriority(8);
NutThreadSetPriority(16);
NutThreadSetPriority(32);
NutThreadSetPriority(128);
NutThreadSetPriority(129);
NutThreadSetPriority(130);
NutThreadSetPriority(131);
NutThreadSetPriority(8);
File arch\arm\dev\at91sam7x_emac.c:
NutThreadSetPriority(9); <-------------------------
File arch\arm\dev\ax88796.c:
NutThreadSetPriority(9); <-------------------------
File arch\arm\dev\cs8900a.c:
NutThreadSetPriority(8); <-------------------------
File arch\arm\dev\dm9000e.c:
NutThreadSetPriority(9); <-------------------------
File arch\arm\os\nutinit.c:
NutThreadSetPriority(254);
File arch\avr\dev\ahdlcavr.c:
NutThreadSetPriority(9); <-------------------------
File arch\avr\dev\cs8900.c:
NutThreadSetPriority(8); <-------------------------
File arch\avr\dev\lanc111.c:
NutThreadSetPriority(9); <-------------------------
File arch\avr\dev\nicrtl.c:
NutThreadSetPriority(9); <-------------------------
File arch\avr\dev\sja1000.c:
NutThreadSetPriority(16); <-------------------------
File arch\avr\os\nutinit.c:
NutThreadSetPriority(254);
File arch\h8300h\dev\nicrtl.c:
NutThreadSetPriority(9); <-------------------------
File arch\h8300h\os\nutinit.c:
NutThreadSetPriority(254);
File arch\m68k\os\nutinit.c:
NutThreadSetPriority(254);
File arch\unix\os\nutinit.c:
NutThreadSetPriority(254);
File include\sys\thread.h:
extern u_char NutThreadSetPriority(u_char level);
File net\tcpsm.c:
NutThreadSetPriority (32); <-------------------------
File os\thread.c:
* Rewrote CS in NutThreadSetPriority
u_char NutThreadSetPriority(u_char level)
NutThreadSetPriority(255);
File pro\sntp.c:
NutThreadSetPriority(63);
I:\ethernut_4.1.9\nut>
-----Ursprüngliche Nachricht-----
Von: en-nut-discussion-bounces at egnite.de
[mailto:en-nut-discussion-bounces at egnite.de] Im Auftrag von Michel Hendriks
Gesendet: Dienstag, 15. Mai 2007 13:54
An: En-Nut-Discussion at egnite.de
Betreff: [En-Nut-Discussion] Thread priority
Hi guys,
Can anyone answer me why the comment for the NutThreadSetPriority() function
says that thread priority of applications are limited to the 32.254 range?
The reason I am asking is because e.g. the "rxi5" thread has a prio of 9 and
I would like to create a thread that is *always* the highest prio.
Can I safely ignore the comment and use prio 1, or should I lower the prio
of the rxi5 thread????
Greets
Michel Hendriks
_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion
--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.467 / Virus Database: 269.7.1/805 - Release Date: 15.05.2007
10:47
More information about the En-Nut-Discussion
mailing list