I have the following simple problem. I am trying to auto initialize and run
these threads. Even they can work one by one periodically. However, i am
even if i am trying to switch to ccc thread from rcv thread using
sched_run() or thread_yield(); it never runs the ccc thread. I tried to
thread_sleep, but it is just another overhead and overload to run multiple
threads sequentially.
Where am i wrong ? Thanks for your help.
#include "thread.h"
#include "stdio.h"
#include "msg.h"
char rcv_thread_stack[THREAD_STACKSIZE_MAIN];
char ccc_thread_stack[THREAD_STACKSIZE_MAIN];
void *rcv_thread(void *arg)
{
thread_yield();
(void) arg;
// msg_t m;
while (1) {
printf("!!!!!!!!!!");
-> // sched_run() or thread_yield();
}
return NULL;
}
void *ccc_thread(void *arg)
{
(void) arg;
// msg_t m;
while (1) {
printf("*******************");
}
return NULL;
}
int main(void)
{
thread_create(rcv_thread_stack, sizeof(rcv_thread_stack),
THREAD_PRIORITY_MAIN - 1, THREAD_CREATE_STACKTEST,
rcv_thread, NULL, "rcv_thread");
thread_create(ccc_thread_stack, sizeof(ccc_thread_stack),
THREAD_PRIORITY_MAIN - 1, THREAD_CREATE_STACKTEST,
ccc_thread, NULL, "ccc_thread");
while(1){
printf("****");
}
}
_______________________________________________
users mailing list
[email protected]
https://lists.riot-os.org/mailman/listinfo/users