AW: AW: [En-Nut-Discussion] NutThreadSetPriority
Oliver Schulz
Oliver.Schulz at bong.de
Fri Dec 5 14:36:25 CET 2003
Hi Yuri,
>
> as you may see, there are 4 httpd threads. but there are also TWO rxi5
> threads...
> for as much as i know, the rxi5 thread is the ethernet
> receive thread...
> shouldnt there be 1 rxi5 and 1 txi5 thread, instead of 2 rxi5 threads?
There should be just ONE rxi5 thread, for sure. This thread is created by a call to NutRegisterDevice (eth0,...);
So be sure not to call this function twice!
A transmitter thread does not exists, however if a thread sends some bytes to the nic, it is suspended until the transmission of the packet is finished.
Here a code snippet from httpd:
char *thname = "httpd0";
thname[5] = '0' + i;
You can see here, that the string index [5] is the char '0', not the termination character. If you use a shorter name like "main", you must supply one byte for the numbering ("main0") and of course adjust the index 5 to 4..
If you use "NUTTHREADINFO *tdp = nutThreadList;" outside the loop, tdp points always to the last created thread, when this assignment is executed. To make it work correctly, assign the return value of NutThreadCreate to tdp!
Oliver.
More information about the En-Nut-Discussion
mailing list