This is the mail archive of the
ecos-devel@sourceware.org
mailing list for the eCos project.
I have a problem with the priority of ecos
- From: moktar_bouain <moktarbouain at yahoo dot fr>
- To: ecos-devel at ecos dot sourceware dot org
- Date: Tue, 12 Apr 2011 14:25:23 -0700 (PDT)
- Subject: I have a problem with the priority of ecos
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);
cyg_thread_create(10, taska, (cyg_addrword_t) 0,"Thread A", (void *)
stack[0], 4096,&simple_threadA, &thread_s[0]);
cyg_thread_create(0, taskb, (cyg_addrword_t) 1,"Thread B", (void *)
stack[1], 4096,&simple_threadB, &thread_s[1]);
}
void main (cyg_addrword_t data)
{
for(;;)
{
cyg_thread_resume(simple_threadA);
cyg_thread_resume(simple_threadB);
}
}
when I execute this configuration:
TASKB
TASKB
TASKB
TASKB
TASKB
TASKB
TASKB
TASKB
TASKB
TASKB
TASKB
but when I changed the priority:
cyg_thread_create(1, taska, (cyg_addrword_t) 0,"Thread A", (void *)
stack[0], 4096,&simple_threadA, &thread_s[0]);
cyg_thread_create(0, taskb, (cyg_addrword_t) 1,"Thread B", (void *)
stack[1], 4096,&simple_threadB, &thread_s[1]);
I find this false result
TASKB
TASKA
TASKB
TASKA
TASKB
TASKA
TASKB
TASKA
TASKB
TASKA
TASKB
TASKA
TASKB
TASKA
TASKB
Any help??
--
View this message in context: http://old.nabble.com/I-have-a-problem--with--the-priority-of-ecos-tp31383032p31383032.html
Sent from the Sourceware - ecos-devel mailing list archive at Nabble.com.