12 Apr 2011 23:25
I have a problem with the priority of ecos
moktar_bouain <moktarbouain <at> yahoo.fr>
2011-04-12 21:25:23 GMT
2011-04-12 21:25:23 GMT
Hello ,
I have a problem with the priority of ecos.
I have the following configuration:
#include <cyg/kernel/kapi.h>
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
cyg_thread thread_s[2];
char stack[2][4096];
cyg_handle_t simple_threadA, simple_threadB;
cyg_mutex_t cliblock;
void taska(cyg_addrword_t data)
{
printf("TASKA \n");
}
void taskb(cyg_addrword_t data)
{
printf("TASKB \n");
}
void cyg_user_start(void)
{
printf("Entering twothreads' cyg_user_start() function\n");
cyg_mutex_init(&cliblock);
(Continue reading)
)
On 04/13/2011 02:36 AM, moktar_bouain wrote:
> On 04/12/2011 05:02 PM, moktar_bouain wrote:
>> Hi Thomas,
>> I use bitmap scheduling with 31 level for priority(by default).
>> I tried with diag_printf() but the same thing.
better use cyg_thread_delay(1). (not with 0 delay, this does nothing;
also cyg_thread_yield only switches between 2 threads with the same
priority)
>> What else is configured in your system (what template did you build from)?
>> My guess is that there is another thread already at priority 10.
Indeed. Here my list of default eCos thread priorities:
Priorities go from 0 to CYGNUM_KERNEL_SCHED_PRIORITIES-1. By default,
CYGNUM_KERNEL_SCHED_PRIORITIES=32.
So by default priorities go from 0 to 31.
priority name default stack name
default size
CYGSEM_KERNEL_SYNCH_MUTEX_PRIORITY_
INVERSION_PROTOCOL_DEFAULT_PRIORITY 0
_POSIX_THREAD_PRIORITY_SCHEDULING 1 _POSIX_THREAD_ATTR_STACKSIZE
1 posix unit
CYGPKG_NET_FAST_THREAD_PRIORITY 6
CYGPKG_NET_THREAD_PRIORITY 7
CYGPKG_NET_DHCP_THREAD_PRIORITY 8
CYGINT_NET_IPV6_ROUTING_THREAD_PRIORITY 8
CYGNUM_LIBC_MAIN_THREAD_PRIORITY 10
RSS Feed